import { useMutation } from 'react-query';
import {
  checkSmsKeyRequest,
  CheckSmsKeyRequestDataType,
  CheckSmsKeyRequestReturnType,
  createTempUser,
  CreateTempUserDataType,
  sendSmsKeyRequest,
  SendSmsKeyRequestDataType,
  SendSmsKeyRequestReturnType,
  TempUserType
} from '../../api/temp-user';
import { APIErrorType } from '../../api';

export function useCreateTempUserMutation() {
  return useMutation<TempUserType, APIErrorType, CreateTempUserDataType>(createTempUser);
}

export function useSendSmsKeyMutation() {
  return useMutation<SendSmsKeyRequestReturnType, APIErrorType, SendSmsKeyRequestDataType>(
    sendSmsKeyRequest
  );
}

export function useCheckSmsKeyMutation() {
  return useMutation<CheckSmsKeyRequestReturnType, APIErrorType, CheckSmsKeyRequestDataType>(
    checkSmsKeyRequest
  );
}
