useUpdateWizardCache.tsx 531 B

1234567891011121314151617
  1. import {Client} from 'sentry/api';
  2. import {useMutation} from 'sentry/utils/queryClient';
  3. import useApi from 'sentry/utils/useApi';
  4. const BASE_API_CLIENT = new Client({baseUrl: ''});
  5. export function useUpdateWizardCache(hash: string) {
  6. const baseApi = useApi({api: BASE_API_CLIENT});
  7. return useMutation({
  8. mutationFn: (params: {organizationId: string; projectId: string}) => {
  9. return baseApi.requestPromise(`/account/settings/wizard/${hash}/`, {
  10. method: 'POST',
  11. data: params,
  12. });
  13. },
  14. });
  15. }