enhance UpdateEntity singature
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user