useEntityActions: fix isLoading
This commit is contained in:
parent
1c5a6d8b41
commit
b4c3248791
1 changed files with 2 additions and 0 deletions
|
@ -28,11 +28,13 @@ function useEntityActions<TEntity extends Entity = Entity, Data = any>(
|
|||
const create = useCreateEntity<TEntity, Data>(path, { method: 'post', url: endpoints.post }, opts);
|
||||
|
||||
const createEntity: typeof create = async (...args) => {
|
||||
setIsLoading(true);
|
||||
await create(...args);
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
const deleteEntity: typeof _delete = async (...args) => {
|
||||
setIsLoading(true);
|
||||
await _delete(...args);
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue