'use client'

import { request } from '@/utils'
import { IBaseResponse } from '@/@core/types/api'
import { IEntityProfile } from '@/types/data/profile/profile.interface'
import { useCustomMutation } from '@/hooks/api'

export const useUpdateCoverImage = () => {
  return useCustomMutation<FormData, IBaseResponse<IEntityProfile>>(
    ['profile-update-cover-image'],
    async payload => {
      const res = await request({
        url: '/entity/update-cover-image',
        method: 'POST',
        data: payload
      })
      return res.data
    }
  )
}
