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

export const apiGetAdminCourses = (params) => http.get(endpoints.getCoursesList, { params })

export const apiShowAdminCourse = (id) => http.get(buildUrl(endpoints.showCourse, { id }))

export const apiAddAdminCourse = (payload) => http.post(endpoints.addNewCourse, payload)

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

export const apiDeleteAdminCourse = (id) => http.delete(buildUrl(endpoints.deleteCourse, { id }))
