mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 11:08:12 +00:00
user account create
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
UseQueryOptions,
|
||||
UseMutationOptions
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -70,10 +71,34 @@ export function endpoint<TInput, TResponse>(
|
||||
};
|
||||
};
|
||||
|
||||
const mutationOptions = (
|
||||
config?: Omit<
|
||||
UseMutationOptions<
|
||||
TResponse,
|
||||
Error,
|
||||
TInput
|
||||
>,
|
||||
"mutationFn"
|
||||
>,
|
||||
): UseMutationOptions<
|
||||
TResponse,
|
||||
Error,
|
||||
TInput
|
||||
> => {
|
||||
return {
|
||||
...config,
|
||||
mutationFn: (
|
||||
variables: TInput,
|
||||
): Promise<TResponse> =>
|
||||
execute(variables),
|
||||
};
|
||||
};
|
||||
|
||||
return {
|
||||
call,
|
||||
queryKey,
|
||||
queryOptions,
|
||||
mutationOptions
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user