17 lines
783 B
JavaScript
17 lines
783 B
JavaScript
// Admin services UI hits the same /admin/tickets endpoints as the messages
|
|
// UI, scoped by ?type=service. Show/send/status reuse the admin-tickets
|
|
// helpers since the URL pattern is identical.
|
|
import { http } from '@/services/api/http'
|
|
import { buildUrl, endpoints } from '@/services/api/endpoints'
|
|
|
|
export const apiGetAdminServices = (params) =>
|
|
http.get(endpoints.getTicketsList, { params: { ...params, type: 'service' } })
|
|
|
|
export const apiShowAdminService = (id) => http.get(buildUrl(endpoints.showTicket, { id }))
|
|
|
|
export const apiSendAdminServiceMessage = (id, payload) =>
|
|
http.post(buildUrl(endpoints.sendTicketMessage, { id }), payload)
|
|
|
|
export const apiChangeAdminServiceStatus = (id, payload) =>
|
|
http.patch(buildUrl(endpoints.changeTicketStatus, { id }), payload)
|