Skip to content

Commit ae66e0f

Browse files
homework is now already coming as object bcz of prisma migration, no need to parse
1 parent 51eb14e commit ae66e0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/alea-frontend/pages/api/homework/get-homework-list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export async function getAllHomeworksOrSetError(
2222
homeworks.sort((a, b) => a.dueTs - b.dueTs);
2323
if (getProblems) {
2424
for (const homework of homeworks) {
25-
homework.problems = JSON.parse(homework.problems);
25+
if (typeof homework.problems === 'string') {
26+
homework.problems = JSON.parse(homework.problems);
27+
}
2628
}
2729
}
2830
return getProblems

0 commit comments

Comments
 (0)