Feat: Add LoadingButton #4368 (#4384)

### What problem does this PR solve?

Feat: Add LoadingButton #4368

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-01-07 12:53:06 +08:00
committed by GitHub
parent 16e1681fa4
commit d088a34fe2
5 changed files with 85 additions and 24 deletions

View File

@ -321,7 +321,7 @@ export const useRenameTag = () => {
isPending: loading,
mutateAsync,
} = useMutation({
mutationKey: ['deleteTag'],
mutationKey: ['renameTag'],
mutationFn: async (params: IRenameTag) => {
const { data } = await renameTag(knowledgeBaseId, params);
if (data.code === 0) {
@ -337,4 +337,8 @@ export const useRenameTag = () => {
return { data, loading, renameTag: mutateAsync };
};
export const useTagIsRenaming = () => {
return useIsMutating({ mutationKey: ['renameTag'] }) > 0;
};
//#endregion