From d654b30acb0c847b2bda30d9ee01350547458c8a Mon Sep 17 00:00:00 2001 From: Anna Zabolotskaya Date: Wed, 13 Mar 2024 15:49:03 +0100 Subject: [PATCH] field types adjustments --- FunctionApp/SharePoint/ListData.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FunctionApp/SharePoint/ListData.cs b/FunctionApp/SharePoint/ListData.cs index 465b719..00ab899 100644 --- a/FunctionApp/SharePoint/ListData.cs +++ b/FunctionApp/SharePoint/ListData.cs @@ -50,7 +50,7 @@ public async Task GetCompanies( [FunctionName("GetEmployees")] public async Task GetEmployees( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "all-companies/{companyId}/employees")] HttpRequest req, - string companyId, ILogger log) + string company, ILogger log) { log.LogInformation("Employees list is requested."); @@ -61,7 +61,7 @@ public async Task GetEmployees( { new("select", "id"), new("expand", "fields(select=Title,CSCS)"), - new("filter", $"fields/CompanyLookupId eq '{companyId}'"), + new("filter", $"fields/Company eq '{company}'"), new("orderby", "fields/Title") })); } @@ -82,7 +82,7 @@ public async Task GetSignedInCompanies( var listItems = await list.GetListItems(new List { new("select", "id"), - new("expand", "fields(select=Company,CompanyLookupId)"), + new("expand", "fields(select=Company)"), new("filter", $"fields/Site eq '{siteName}' and fields/CurrentStatus eq 'In'"), new("orderby", "fields/Company") }); @@ -96,7 +96,7 @@ public async Task GetSignedInCompanies( [FunctionName("GetSignedInEmployees")] public async Task GetSignedInEmployees( [HttpTrigger(AuthorizationLevel.Function, "get", Route = "sites/{siteName}/companies/{companyId}/signed-in-employees")] HttpRequest req, - string siteName, string companyId, ILogger log) + string siteName, string company, ILogger log) { log.LogInformation("Signed In employees list is requested."); @@ -108,7 +108,7 @@ public async Task GetSignedInEmployees( new("select", "id"), new("expand", "fields(select=Title)"), new("filter", - $"fields/Site eq '{siteName}' and fields/CompanyLookupId eq '{companyId}' and fields/CurrentStatus eq 'In'"), + $"fields/Site eq '{siteName}' and fields/Company eq '{company}' and fields/CurrentStatus eq 'In'"), new("orderby", "fields/Title") });