import { http } from '@/services/api/http'
import { buildUrl, endpoints } from '@/services/api/endpoints'

export const apiGetAdminConsultations = (params) =>
  http.get(endpoints.getConsultationsList, { params })

export const apiShowAdminConsultation = (id) =>
  http.get(buildUrl(endpoints.showConsultation, { id }))

export const apiSendAdminConsultationMessage = (id, payload) =>
  http.post(buildUrl(endpoints.sendConsultationMessage, { id }), payload)

// Backend uses PATCH (not POST).
export const apiChangeAdminConsultationStatus = (id, payload) =>
  http.patch(buildUrl(endpoints.changeConsultationStatus, { id }), payload)
