From b6b07b907c8a66a35c7d52bd3ec58145af19976b Mon Sep 17 00:00:00 2001 From: Anna Zabolotskaya Date: Mon, 8 Apr 2024 09:49:01 +0200 Subject: [PATCH] move personID param to request body --- FunctionApp/UploadDocumentToLoxo.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/FunctionApp/UploadDocumentToLoxo.cs b/FunctionApp/UploadDocumentToLoxo.cs index afd0d80..1bc6856 100644 --- a/FunctionApp/UploadDocumentToLoxo.cs +++ b/FunctionApp/UploadDocumentToLoxo.cs @@ -25,19 +25,21 @@ public async Task Run( HttpRequest req, ILogger log) { - string personId = req.Query["person-id"]; - if (string.IsNullOrEmpty(personId)) - { - return new BadRequestObjectResult("Missing person-id in query parameters."); - } var requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); string fileUrl = data?.fileUrl; + string personId = data?.data?.personID; + if (string.IsNullOrEmpty(fileUrl)) { return new BadRequestObjectResult("Missing fileUrl in request body."); } + + if (string.IsNullOrEmpty(personId)) + { + return new BadRequestObjectResult("Missing personID in request body."); + } using var httpClient = new HttpClient();