korean-dummy-json-fetcher
Version:
한국어 더미 데이터 생성 라이브러리
33 lines (32 loc) • 733 B
JavaScript
import { fetcher } from "./api.js";
export async function getUser({ id, }) {
return fetcher(`/users/${id}`);
}
export async function getUsers(options) {
return fetcher("/users", {
params: options,
});
}
export async function createUser(data) {
return fetcher("/users", {
method: "POST",
body: data,
});
}
export async function patchUser(id, data) {
return fetcher(`/users/${id}`, {
method: "PATCH",
body: data,
});
}
export async function putUser(id, data) {
return fetcher(`/users/${id}`, {
method: "PUT",
body: data,
});
}
export async function deleteUser({ id }) {
return fetcher(`/users/${id}`, {
method: "DELETE",
});
}