add
This commit is contained in:
parent
4ec92966ab
commit
4c89a43197
|
@ -11,7 +11,11 @@ export function useStaff() {
|
|||
const create = api.staff.create.useMutation({
|
||||
onSuccess: (result) => {
|
||||
queryClient.invalidateQueries({ queryKey });
|
||||
emitDataChange(ObjectType.STAFF, result as any, CrudOperation.CREATED)
|
||||
emitDataChange(
|
||||
ObjectType.STAFF,
|
||||
result as any,
|
||||
CrudOperation.CREATED
|
||||
);
|
||||
},
|
||||
});
|
||||
const updateUserDomain = api.staff.updateUserDomain.useMutation({
|
||||
|
@ -22,7 +26,12 @@ export function useStaff() {
|
|||
const update = api.staff.update.useMutation({
|
||||
onSuccess: (result) => {
|
||||
queryClient.invalidateQueries({ queryKey });
|
||||
emitDataChange(ObjectType.STAFF, result as any, CrudOperation.UPDATED)
|
||||
queryClient.invalidateQueries({ queryKey: getQueryKey(api.post) });
|
||||
emitDataChange(
|
||||
ObjectType.STAFF,
|
||||
result as any,
|
||||
CrudOperation.UPDATED
|
||||
);
|
||||
},
|
||||
});
|
||||
const softDeleteByIds = api.staff.softDeleteByIds.useMutation({
|
||||
|
@ -38,6 +47,6 @@ export function useStaff() {
|
|||
update,
|
||||
softDeleteByIds,
|
||||
getStaff,
|
||||
updateUserDomain
|
||||
updateUserDomain,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue