'use client'

import type { IBaseResponse } from '@/@core/types/api'
import { request } from '@/utils'
import { IOrder } from '@/types/data'
import { useCustomMutation } from '@/hooks/api'

export const useFindOrderByNumber = () => {
  return useCustomMutation<string, IBaseResponse<IOrder>>(
    ['orders-find-by-number'],
    orderNumber =>
      request({
        url: `/orders/find/${orderNumber}`,
        withToken: true
      })
  )
}
