Skip to content

Commit

Permalink
Merge pull request #101 from noahstreller/develop
Browse files Browse the repository at this point in the history
fix: new semester should only clear category
  • Loading branch information
noahstreller authored Jan 31, 2025
2 parents 7699326 + 2dceb84 commit e8e4182
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions components/new-semester-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import {
} from "@/lib/services/export-service";
import { exportToJSONFile } from "@/lib/services/notAsyncLogic";
import {
clearUserGrades,
clearUserSubjectsGrades,
clearUserGradesByCategory,
clearUserSubjectsGradesByCategory,
} from "@/lib/services/user-service";
import { CalendarPlus } from "lucide-react";
import { useTranslations } from "next-intl";
Expand Down Expand Up @@ -86,8 +86,10 @@ export const NewSemesterButton = ({
if (archiveData) {
await archiveCategory(data);
}
if (!keepSubjects) await clearUserSubjectsGrades();
if (!keepGrades && keepSubjects) await clearUserGrades();
if (!keepSubjects)
await clearUserSubjectsGradesByCategory(categoryState.category?.id!);
if (!keepGrades && keepSubjects)
await clearUserGradesByCategory(categoryState.category?.id!);
} finally {
setIsOpen(false);
window.location.reload();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grade-calculator",
"version": "3.0.0",
"version": "3.0.1",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sonar.projectKey=noahstreller_grade-calculator_82dd3c4f-6188-433f-838c-8ce4d84da62e
sonar.projectVersion=3.0.0
sonar.projectVersion=3.0.1

0 comments on commit e8e4182

Please sign in to comment.