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

Function updateStatus

apps/client/components/TicketDetails/index.tsx:186–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184 }
185
186 async function updateStatus() {
187 if (data && data.ticket && data.ticket.locked) return;
188
189 const res = await fetch(`/api/v1/ticket/status/update`, {
190 method: "PUT",
191 headers: {
192 "Content-Type": "application/json",
193 Authorization: `Bearer ${token}`,
194 },
195 body: JSON.stringify({
196 status: !data.ticket.isComplete,
197 id,
198 }),
199 }).then((res) => res.json());
200
201 if (!res.success) {
202 toast({
203 variant: "destructive",
204 title: "Error",
205 description: res.message || "Failed to update status",
206 });
207 return;
208 }
209 refetch();
210 }
211
212 async function hide(hidden) {
213 if (data && data.ticket && data.ticket.locked) return;

Callers 1

TicketFunction · 0.70

Calls 1

toastFunction · 0.90

Tested by

no test coverage detected