import client from './client'

export const getJobs = (params) => client.get('/jobs/public/', { params })
export const getJob = (id) => client.get(`/jobs/public/${id}/`)
export const manageJobs = (page = 1) => client.get('/jobs/manage/', { params: { page } })
export const createJob = (data) => client.post('/jobs/manage/', data)
export const updateJob = (id, data) => client.patch(`/jobs/manage/${id}/`, data)
export const deleteJob = (id) => client.delete(`/jobs/manage/${id}/`)
export const toggleFavorite = (id) => client.post(`/jobs/public/${id}/favorite/`)
export const getMyFavorites = () => client.get('/jobs/favorites/')
