Skip to content

Commit

Permalink
move personID param to request body
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyziggy committed Apr 8, 2024
1 parent 90561d3 commit b6b07b9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions FunctionApp/UploadDocumentToLoxo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ public async Task<IActionResult> 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();

Expand Down

0 comments on commit b6b07b9

Please sign in to comment.