MCPcopy Create free account
hub / github.com/GreatStackDev/project-management / handleStatusChange

Function handleStatusChange

src/components/ProjectTasks.jsx:57–74  ·  view source on GitHub ↗
(taskId, newStatus)

Source from the content-addressed store, hash-verified

55 };
56
57 const handleStatusChange = async (taskId, newStatus) => {
58 try {
59 toast.loading("Updating status...");
60
61 // Simulate API call
62 await new Promise((resolve) => setTimeout(resolve, 2000));
63
64 let updatedTask = structuredClone(tasks.find((t) => t.id === taskId));
65 updatedTask.status = newStatus;
66 dispatch(updateTask(updatedTask));
67
68 toast.dismissAll();
69 toast.success("Task status updated successfully");
70 } catch (error) {
71 toast.dismissAll();
72 toast.error(error?.response?.data?.message || error.message);
73 }
74 };
75
76 const handleDelete = async () => {
77 try {

Callers 1

ProjectTasksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected