MCPcopy
hub / github.com/Peppermint-Lab/peppermint / deleteComment

Function deleteComment

apps/client/components/TicketDetails/index.tsx:313–334  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

311 }
312
313 async function deleteComment(id: string) {
314 await fetch(`/api/v1/ticket/comment/delete`, {
315 method: "POST",
316 headers: {
317 "Content-Type": "application/json",
318 Authorization: `Bearer ${token}`,
319 },
320 body: JSON.stringify({ id }),
321 })
322 .then((res) => res.json())
323 .then((res) => {
324 if (res.success) {
325 refetch();
326 } else {
327 toast({
328 variant: "destructive",
329 title: "Error",
330 description: "Failed to delete comment",
331 });
332 }
333 });
334 }
335
336 async function addTime() {
337 if (data && data.ticket && data.ticket.locked) return;

Callers 1

TicketFunction · 0.85

Calls 1

toastFunction · 0.90

Tested by

no test coverage detected