import request from '../utils/request'

export function getCategoryTree() {
  return request.get('/categories')
}

export function createCategory(data) {
  return request.post('/categories', data)
}

export function updateCategory(id, data) {
  return request.put(`/categories/${id}`, data)
}

export function deleteCategory(id) {
  return request.delete(`/categories/${id}`)
}

export function moveCategory(id, parentId) {
  return request.put(`/categories/${id}/move`, { parentId })
}
