import { IBaseResponse } from '@/@core/types/api'
import { useCustomMutation } from '@/hooks/api'
import { request } from '@/utils'
import { CODE_URL, PASSWORD_URL } from '.'
/* import { ISendCode } from '@/types/data/password'
 */ import { useParams } from 'next/navigation'

export const SEND_CODE_QUERY = 'send-code'

export const useSendCode = () => {
  const createPlanMutation = useCustomMutation<any, IBaseResponse<any>>(
    [SEND_CODE_QUERY],
    data => {
      return request<IBaseResponse<any>, any>({
        url: `${[...CODE_URL]}`,
        method: 'POST',
        data
      })
    },
    {
      toastMessageType: 'promise'
    }
  )

  return createPlanMutation
}
