MCPcopy Create free account
hub / github.com/code100x/daily-code / handleEdit

Function handleEdit

apps/web/components/admin/ProblemCard.tsx:27–33  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

25 const [type, setType] = useState(problem.type);
26 const [notionDocId, setNotionDocId] = useState(problem.notionDocId);
27 function handleEdit(id: string) {
28 if (isEditing) {
29 updateProblem(problem.id, { id, title, description, type, notionDocId });
30 return setIsEditing(false);
31 }
32 setIsEditing(true);
33 }
34 function handleDiscardButton() {
35 setTitle(problem.title);
36 setDescription(problem.description);

Callers 1

ProblemCardFunction · 0.70

Calls 1

updateProblemFunction · 0.90

Tested by

no test coverage detected