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

export const CLEAR_CACHE_QUERY_KEY = 'clear-cache'

export const useClearCache = () => {
  const updateMutation = useCustomMutation<any, IBaseResponse<any>>([CLEAR_CACHE_QUERY_KEY], data => {
    return request<IBaseResponse<any>, any>({
      url: `dashboard/clear-cache`,
      method: 'POST'
    })
  })
  return updateMutation
}
