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

Function handleEdit

apps/web/components/admin/EditTrackCard.tsx:28–34  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

26 const [selectedCategory, setSelectedCategory] = useState<string[]>(Track.categories.map((item) => item.category.id));
27
28 function handleEdit(id: string) {
29 if (isEditing) {
30 updateTrack(id, { id, title, description, image, hidden, selectedCategory, cohort, trackType, canvaLink });
31 return setIsEditing(false);
32 }
33 setIsEditing(true);
34 }
35
36 function handleFilterButton(category: string) {
37 if (selectedCategory.includes(category)) {

Callers 1

EditTrackCardFunction · 0.70

Calls 1

updateTrackFunction · 0.90

Tested by

no test coverage detected