agent/api.js

27 lines
610 B
JavaScript
Raw Normal View History

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