mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-18 13:49:06 +02:00
feat(api-endpoints.ts): add abortRequest endpoint
feat(data-service.ts): add abortRequestWithMessage function feat(react-query-service.ts): add useAbortRequestWithMessage hook
This commit is contained in:
parent
f946f90ef6
commit
828e438d53
3 changed files with 12 additions and 0 deletions
|
|
@ -21,6 +21,10 @@ export enum QueryKeys {
|
|||
tokenCount = "tokenCount",
|
||||
}
|
||||
|
||||
export const useAbortRequestWithMessage = (): UseMutationResult<void, Error, { endpoint: string; abortKey: string; message: string }> => {
|
||||
return useMutation(({ endpoint, abortKey, message }) => dataService.abortRequestWithMessage(endpoint, abortKey, message));
|
||||
};
|
||||
|
||||
export const useGetUserQuery = (): QueryObserverResult<t.TUser> => {
|
||||
return useQuery<t.TUser>([QueryKeys.user], () => dataService.getUser(), {
|
||||
refetchOnWindowFocus: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue