import request from '@/utils/request'

export function fetchList() {
  return request({
    url: '/finance/receipt/users',
    method: 'get'
  })
}

export function getUser(id) {
  return request({
    url: '/finance/receipt/user/' + id,
    method: 'get'
  })
}

export function updateUser(id, data) {
  return request({
    url: '/finance/receipt/user/update/' + id,
    method: 'post',
    data: data
  })
}

export function createUser(data) {
  return request({
    url: '/finance/receipt/user/create',
    method: 'post',
    data: data
  })
}

export function deleteUser(id) {
  return request({
    url: '/finance/receipt/user/delete/' + id,
    method: 'post'
  })
}

export function fetchPermissionList() {
  return request({
    url: '/finance/receipt/permissions',
    method: 'get'
  })
}
