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

export const apiGetAdminSessions = (params) => http.get(endpoints.getSessionsList, { params })

export const apiShowAdminSession = (id) => http.get(buildUrl(endpoints.showSession, { id }))

export const apiAddAdminSession = (payload) => http.post(endpoints.addNewSession, payload)

export const apiUpdateAdminSession = (id, payload) =>
  http.patch(buildUrl(endpoints.updateSession, { id }), payload)

export const apiDeleteAdminSession = (id) => http.delete(buildUrl(endpoints.deleteSession, { id }))

export const apiGetSessionAttendance = (sessionId, params) =>
  http.get(buildUrl(endpoints.getSessionsAttendance, { sessionId }), { params })
