Skip to content

Commit

Permalink
fix: revert GetTemplates method
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolfosh committed Jan 12, 2024
1 parent 58a8d61 commit 9d4cc9c
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,18 @@ public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "

List<Template> response = new List<Template>();

try
{
var queryResult = _tableClient.Query<Template>();
var queryResult = _tableClient.Query<Template>();

response.AddRange(queryResult.Where(t => t.DeactivationDate <= DateTime.Now));

response.OrderBy(t => t.Id);
}
catch (Exception ex)
foreach (var template in queryResult)
{
return new NotFoundObjectResult(ex.Message);
if (template?.DeactivationDate <= DateTime.Now)
{
continue;
}
response.Add(template);
}

response.OrderBy(t => t.Id);

log.LogInformation($"GetTemplates returned {response.Count} templates");
return new OkObjectResult(response);
Expand Down

0 comments on commit 9d4cc9c

Please sign in to comment.