import type { AxiosResponse } from "axios"; import axios from "axios"; import { useMutation } from "react-query"; import type { MutationOptions } from "@/@types/types/query.types"; interface LoginMutationReponseDTO { access_token: string; token_type: string; expires_in: number; } export const useLoginMutation = ( options?: MutationOptions>, ) => { const service = (variables: { username: string; password: string }) => axios.post("/api/auth/login", variables); return useMutation(service, options); };