Updated Endpoints

Updated all endpoints to use Update() method of the model, instead of
trying to use the data from the REST object directly to update the
database.  WHen doing so, tracking gets busted in EFCore, so instead,
will go through and update all properties of a model from the database
object, with the data from the REST object.
This commit is contained in:
Mario Steele 2025-07-21 17:10:42 -05:00
parent 21af6f4300
commit 157d46ee2e
5 changed files with 25 additions and 7 deletions

View file

@ -20,7 +20,10 @@ public static class HistoryEndpoint
if (results == null)
await repository.AddAsync(history, ct);
else
await repository.UpdateAsync(history, ct);
{
results.Update(history);
await repository.UpdateAsync(results, ct);
}
return Results.Ok();
});