mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat(cms): content not getting updated removed comments
This commit is contained in:
parent
adffbdaead
commit
f8a6eb80ff
@ -42,27 +42,12 @@ export const useUpdate = <
|
||||
) => {
|
||||
const api = useEntityApiClient<TAttr, TBasic, TFull>(entity);
|
||||
const normalizeAndCache = useNormalizeAndCache<TBasic, string>(entity);
|
||||
// const queryClient = useQueryClient();
|
||||
// const { invalidate = true } = options || {};
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ id, params }) => {
|
||||
const data = await api.update(id, params);
|
||||
const { entities, result } = normalizeAndCache(data);
|
||||
|
||||
// if (invalidate) {
|
||||
// queryClient.removeQueries({
|
||||
// predicate: ({ queryKey }) => {
|
||||
// const [qType, qEntity] = queryKey;
|
||||
|
||||
// return (
|
||||
// (qType === QueryType.count || qType === QueryType.collection) &&
|
||||
// isSameEntity(qEntity, entity)
|
||||
// );
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
|
||||
return entities[entity]?.[result] as unknown as TBasic;
|
||||
},
|
||||
...options,
|
||||
|
Loading…
Reference in New Issue
Block a user