Files
mtdb_movie/common/resources/client/auth/requests/disconnect-social.ts
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

26 lines
685 B
TypeScript
Executable File

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);
}