|
@@ -1,17 +1,18 @@
|
|
|
import { useMutation } from '@tanstack/react-query';
|
|
|
|
|
|
import { chatQueryKeys } from '../chat-query-keys';
|
|
|
-import { chatApi, type PostCreateGroup } from '../chat-api';
|
|
|
+import { chatApi, type PostCreateGroup, type PostCreateGroupReturn } from '../chat-api';
|
|
|
|
|
|
import type { BaseAxiosError } from '../../../../types';
|
|
|
-import { ResponseType } from '@api/response-type';
|
|
|
|
|
|
export const usePostCreateGroupMutation = () => {
|
|
|
- return useMutation<ResponseType, BaseAxiosError, PostCreateGroup, ResponseType>({
|
|
|
- mutationKey: chatQueryKeys.createGroup(),
|
|
|
- mutationFn: async (data) => {
|
|
|
- const response = await chatApi.createGroup(data);
|
|
|
- return response.data;
|
|
|
+ return useMutation<PostCreateGroupReturn, BaseAxiosError, PostCreateGroup, PostCreateGroupReturn>(
|
|
|
+ {
|
|
|
+ mutationKey: chatQueryKeys.createGroup(),
|
|
|
+ mutationFn: async (data) => {
|
|
|
+ const response = await chatApi.createGroup(data);
|
|
|
+ return response.data;
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ );
|
|
|
};
|