MCPcopy
hub / github.com/tolgee/tolgee-platform / getApiMutationOptions

Function getApiMutationOptions

webapp/src/service/http/useQueryApi.ts:190–204  ·  view source on GitHub ↗
(
  invalidatePrefix: undefined | string | string[],
  queryClient: QueryClient
)

Source from the content-addressed store, hash-verified

188}
189
190function getApiMutationOptions(
191 invalidatePrefix: undefined | string | string[],
192 queryClient: QueryClient
193) {
194 return (options: UseQueryOptions<any, ApiError> | undefined) => ({
195 ...options,
196 onSuccess: (...params) => {
197 // @ts-ignore
198 options?.onSuccess?.(...params);
199 if (invalidatePrefix !== undefined) {
200 invalidateUrlPrefix(queryClient, invalidatePrefix);
201 }
202 },
203 });
204}
205
206const getMutationCallback = <
207 MutationFn extends (variables: any, options: any) => any

Callers 2

useApiMutationFunction · 0.85

Calls 1

invalidateUrlPrefixFunction · 0.85

Tested by

no test coverage detected