Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 3e428ad8 authored by Kritkhanin Anantakul's avatar Kritkhanin Anantakul
Browse files
parents a20d2561 5c74747c
No related branches found
No related tags found
No related merge requests found
import http from './http'
import type { Employee } from '@/types/Employee'
export async function listEmployees(): Promise<Employee[]> {
const { data } = await http.get('/employees')
return data
}
export async function getEmployee(id: number): Promise<Employee> {
const { data } = await http.get(`/employees/${id}`)
return data
}
export async function createEmployee(payload: Partial<Employee>): Promise<Employee> {
const { data } = await http.post('/employees', payload)
return data
}
export async function updateEmployee(id: number, payload: Partial<Employee>): Promise<Employee> {
const { data } = await http.put(`/employees/${id}`, payload)
return data
}
export async function deleteEmployee(id: number): Promise<void> {
await http.delete(`/employees/${id}`)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment