Devendra174's picture
Upload folder using huggingface_hub
f5071ca verified
raw
history blame contribute delete
708 Bytes
export const fetchComments = postId => (
$.ajax({
url: `/api/posts/${postId}/comments`,
})
);
export const fetchComment = (postId, commentId) => (
$.ajax({
url: `/api/posts/${postId}/comments/${commentId}`,
})
);
export const postComment = (postId, comment) => (
$.ajax({
url: `/api/posts/${postId}/comments`,
method: "POST",
data: { comment },
})
);
export const patchComment = (postId, comment) => (
$.ajax({
url: `/api/posts/${postId}/comments/${comment.id}`,
method: "PATCH",
data: { comment },
})
);
export const deleteComment = (postId, commentId) => (
$.ajax({
url: `/api/posts/${postId}/comments/${commentId}`,
method: "DELETE",
})
);