Skip to content

Commit

Permalink
feat: track adding course
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 committed Dec 8, 2024
1 parent 3e89f42 commit 6b02edd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/umami": "^2.10.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.19",
"eslint": "^9.10.0",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/components/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ export const SearchForm = () => {
e.preventDefault();
const course = courses?.find((c) => c.id === selectedCourseId);
if (!course) return;
const name = `${course.name.subject} ${course.name.code}`;
umami.track('Add course', { subject: course.name.subject, name });
enrolledCourses.addCourse({
name: `${course.name.subject} ${course.name.code}`,
name,
id: course.id,
});
setSelectedCourseId(null);
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"noFallthroughCasesInSwitch": true,

/* Testing */
"types": ["vitest/globals"]
"types": ["vitest/globals", "umami"]
},
"include": ["src", "__tests__"]
}

0 comments on commit 6b02edd

Please sign in to comment.