agent/api.ts

27 lines
652 B
TypeScript
Raw Permalink Normal View History

// Generated from routes/api.php
export const api = {
auth: {
login: (data: any) => fetch(`/api/auth/login`, {
method: "POST",
body: JSON.stringify(data)
}),
},
users: {
list: () => fetch(`/api/users`, {
}),
create: (data: any) => fetch(`/api/users`, {
method: "POST",
body: JSON.stringify(data)
}),
get: (user: number) => fetch(`/api/users/${user}`, {
}),
update: (user: number, data: any) => fetch(`/api/users/${user}`, {
method: "PUT",
body: JSON.stringify(data)
}),
delete: (user: number) => fetch(`/api/users/${user}`, {
method: "DELETE",
}),
},
};