enhance UpdateEntity singature

This commit is contained in:
Pilzinsel64
2025-04-30 13:24:43 +02:00
parent 71eed097a6
commit 83da51bf89
3 changed files with 14 additions and 7 deletions

View File

@@ -29,10 +29,10 @@ public abstract class BaseItemHandler<TEntity, TUpdateMsg>(IApiServer server)
return server.Manager.Get<TEntity>().ToList().Select(ToClient).ToItemsResult();
}
public virtual ApiResult Post(TUpdateMsg msg)
public virtual ApiResult Post(TUpdateMsg msg, ApiRequestInfo req)
{
var entity = CreateNewEntity(msg);
if (UpdateEntity(entity, msg) is ApiResult result)
if (UpdateEntity(new(entity, msg, req)) is ApiResult result)
return result;
server.Manager.Save(entity, true);
return ToClient(entity).ToItemResult(HttpStatusCode.Created);