Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated property name 'teamsApp' to 'teamsAppDefinition'. #1386

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public GraphApiService(
var installedApps = await graphClient.Users[upn].Teamwork.InstalledApps
.Request()
.Filter($"teamsApp/externalId eq '{_configuration["TeamsAppId"]}'")
.Expand("teamsApp")
.Expand("teamsAppDefinition")
.GetAsync(cancellationToken);

var app = installedApps.FirstOrDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ await UtilityHelper.ForEachAsync(usersList, partitionCount, async users => {
{
var installedApp = await graphClient.Users[users.Id].Teamwork.InstalledApps
.Request()
.Expand("teamsApp")
.Expand("teamsAppDefinition")
.GetAsync();

var response = new HttpResponseMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ await graphClientApp.Teams[taskDetails.teamId]

var tabs = await graphClient.Teams[taskDetails.teamId].Channels[taskDetails.channelId].Tabs
.Request()
.Expand("teamsApp")
.Expand("teamsAppDefinition")
.GetAsync();
var tabId = tabs.Where(a => a.DisplayName == "NotifyFeedApp").Select(x => x.Id).ToArray()[0];
var topic = new TeamworkActivityTopic
Expand Down Expand Up @@ -407,7 +407,7 @@ public async Task<ActionResult> sendDefaultNotifications(TaskDetails taskDetails
{
var tabs = await graphClient.Teams[taskDetails.teamId].Channels[taskDetails.channelId].Tabs
.Request()
.Expand("teamsApp")
.Expand("teamsAppDefinition")
.GetAsync();

var tabId = tabs.Where(a => a.DisplayName == "NotifyFeedApp").Select(x => x.Id).ToArray()[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ public async Task<ActionResult> SendNotificationToManager(RequestInfo taskInfo)
.GetAsync();

// Retrieve installed apps for the user from Microsoft Graph API
var installedApps = await graphClient.Users[user.Id].Teamwork.InstalledApps
var installedApps = await graphClient.Users[user.UserPrincipalName].Teamwork.InstalledApps
.Request()
.Expand("teamsApp")
.Expand("teamsAppDefinition")
.GetAsync();

// Filter installed apps to find the one with DisplayName "Tab Request Approval"
var installationId = installedApps.Where(id => id.TeamsApp.DisplayName == "Tab Request Approval").Select(x => x.TeamsApp.Id);
var installationId = installedApps.Where(id => id.TeamsAppDefinition.DisplayName == "Tab Request Approval").Select(x => x.TeamsAppDefinition.Id);

// Check if there is at least one matching installationId
if (installationId.Any())
Expand All @@ -153,13 +153,13 @@ public async Task<ActionResult> SendNotificationToManager(RequestInfo taskInfo)

// Create template parameters for the notification
var templateParameters = new List<Microsoft.Graph.KeyValuePair>()
{
new Microsoft.Graph.KeyValuePair
{
Name = "approvalTaskId",
Value = taskInfo.title
}
};
{
new Microsoft.Graph.KeyValuePair
{
Name = "approvalTaskId",
Value = taskInfo.title
}
};
// Send the activity notification using Microsoft Graph API
await graphClient.Users[user.Id].Teamwork
.SendActivityNotification(topic, "approvalRequired", null, previewText, templateParameters)
Expand Down