enhance UpdateEntity singature
This commit is contained in:
@@ -37,12 +37,12 @@ public abstract class BaseChildItemHandler<TEntity, TParent, TUpdateMsg>(IApiSer
|
||||
return list.ToList().Select(ToClient).ToItemsResult();
|
||||
}
|
||||
|
||||
public virtual ApiResult Post(int parent, TUpdateMsg msg)
|
||||
public virtual ApiResult Post(int parent, TUpdateMsg msg, ApiRequestInfo req)
|
||||
{
|
||||
if (!server.Manager.Find(parent, out TParent? parentEntity))
|
||||
return ApiResult.NotFound();
|
||||
var entity = CreateNewEntity(msg);
|
||||
if (UpdateEntity(entity, msg) is ApiResult result)
|
||||
if (UpdateEntity(new(entity, msg, req)) is ApiResult result)
|
||||
return result;
|
||||
GetChilds(parentEntity).Add(entity);
|
||||
server.Manager.Save(parentEntity, true);
|
||||
|
||||
Reference in New Issue
Block a user