UNPKG

korean-dummy-json-fetcher

Version:

한국어 더미 데이터 생성 라이브러리

31 lines (30 loc) 756 B
import { fetcher } from "./api.js"; export async function getComment({ id, }) { return fetcher(`/comments/${id}`); } export async function getComments(options) { return fetcher("/comments", { params: options }); } export async function createComment(data) { return fetcher("/comments", { method: "POST", body: data, }); } export async function patchComment(id, data) { return fetcher(`/comments/${id}`, { method: "PATCH", body: data, }); } export async function putComment(id, data) { return fetcher(`/comments/${id}`, { method: "PUT", body: data, }); } export async function deleteComment({ id }) { return fetcher(`/comments/${id}`, { method: "DELETE", }); }