mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
update react-query-service
This commit is contained in:
parent
c6d3bcd457
commit
bd53b878d4
1 changed files with 1 additions and 5 deletions
|
|
@ -8,7 +8,6 @@ import {
|
|||
} from "@tanstack/react-query";
|
||||
import * as t from "./types";
|
||||
import * as dataService from "./data-service";
|
||||
import { useRecoilState, useResetRecoilState, useSetRecoilState } from 'recoil';
|
||||
import store from '~/store';
|
||||
|
||||
export enum QueryKeys {
|
||||
|
|
@ -68,15 +67,12 @@ export const useUpdateConversationMutation = (
|
|||
t.TUpdateConversationRequest,
|
||||
unknown
|
||||
> => {
|
||||
const [conversation, setConversation] = useRecoilState(store.conversation);
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation(
|
||||
(payload: t.TUpdateConversationRequest) =>
|
||||
dataService.updateConversation(payload),
|
||||
{
|
||||
onSuccess: (res) => {
|
||||
console.log('res', res);
|
||||
setConversation(res);
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries([QueryKeys.conversation, id]);
|
||||
queryClient.invalidateQueries([QueryKeys.allConversations, id]);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue