mirror of
https://github.com/quay/quay.git
synced 2026-01-27 18:42:52 +03:00
- This PR adds settings pages to the organization and user organization pages. - Admin users can edit their preferences, billing, and organization type - Updated cypress version to address bug https://github.com/cypress-io/cypress/issues/25397
31 lines
854 B
TypeScript
31 lines
854 B
TypeScript
import {useMutation, useQueryClient} from '@tanstack/react-query';
|
|
import {createClientKey} from 'src/resources/UserResource';
|
|
|
|
export function useCreateClientKey({onSuccess, onError}) {
|
|
const queryClient = useQueryClient();
|
|
|
|
const createClientKeyMutator = useMutation(
|
|
async ({password}: {password: string}) => {
|
|
return createClientKey(password);
|
|
},
|
|
{
|
|
onSuccess: () => {
|
|
onSuccess();
|
|
queryClient.invalidateQueries(['user']);
|
|
queryClient.invalidateQueries(['organization']);
|
|
},
|
|
onError: (err) => {
|
|
onError(err);
|
|
},
|
|
},
|
|
);
|
|
|
|
return {
|
|
createClientKey: async (password: string) =>
|
|
createClientKeyMutator.mutate({password}),
|
|
loading: createClientKeyMutator.isLoading,
|
|
error: createClientKeyMutator.error,
|
|
clientKey: createClientKeyMutator.data,
|
|
};
|
|
}
|