UNPKG

korean-dummy-json-fetcher

Version:

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

39 lines (38 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getComment = getComment; exports.getComments = getComments; exports.createComment = createComment; exports.patchComment = patchComment; exports.putComment = putComment; exports.deleteComment = deleteComment; const api_1 = require("./api.js"); async function getComment({ id, }) { return (0, api_1.fetcher)(`/comments/${id}`); } async function getComments(options) { return (0, api_1.fetcher)("/comments", { params: options }); } async function createComment(data) { return (0, api_1.fetcher)("/comments", { method: "POST", body: data, }); } async function patchComment(id, data) { return (0, api_1.fetcher)(`/comments/${id}`, { method: "PATCH", body: data, }); } async function putComment(id, data) { return (0, api_1.fetcher)(`/comments/${id}`, { method: "PUT", body: data, }); } async function deleteComment({ id }) { return (0, api_1.fetcher)(`/comments/${id}`, { method: "DELETE", }); }