JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "disconnect-social.ts"

Full Path: /home/markqprx/iniasli.pro/client/auth/requests/disconnect-social.ts
File size: 685 bytes
MIME-type: text/plain
Charset: utf-8

import {useMutation} from '@tanstack/react-query';
import {BackendResponse} from '../../http/backend-response/backend-response';
import {apiClient} from '../../http/query-client';
import {showHttpErrorToast} from '../../utils/http/show-http-error-toast';

interface Response extends BackendResponse {
  //
}

interface Payload {
  service: string;
}

export function useDisconnectSocial() {
  return useMutation({
    mutationFn: disconnect,
    onError: err => showHttpErrorToast(err),
  });
}

function disconnect(payload: Payload): Promise<Response> {
  return apiClient
    .post(`secure/auth/social/${payload.service}/disconnect`, payload)
    .then(response => response.data);
}