import service from '@/utils/apiService'
const baseUrl = '/api/todos'

export function getToDoList(params) {
  return service({
    url: `${baseUrl}`,
    method: 'get',
    params
  })
}

export function getUserLatestToDoList(userId) {
  return service({
    url: `${baseUrl}/latest-uncomplete`,
    method: 'get',
    params: { userId, applicationCode: process.env.VUE_APP_MODULE_CODE }
  })
}

export function markAsComplete(id) {
  return service({
    url: `${baseUrl}/${id}/mark-as-complete`,
    method: 'post'
  })
}

export function markAsUnComplete(id) {
  return service({
    url: `${baseUrl}/${id}/mark-as-uncomplete`,
    method: 'post'
  })
}
