Skip to content

Commit

Permalink
fix: Duplicate terms based on academic career
Browse files Browse the repository at this point in the history
  • Loading branch information
mathhulk committed Nov 5, 2024
1 parent 3811dd3 commit 60c7803
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/backend/src/scripts/update-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,17 @@ const initialize = async () => {
temporalPosition: { $in: ["Current", "Future"] },
}).lean();

// Remove duplicate terms
const filteredTerms = currentTerms.filter(
({ id }, index) =>
index === currentTerms.findIndex((term) => term.id === id)
);

console.log("\n=== UPDATE CLASSES ===");
await updateClasses(currentTerms);
await updateClasses(filteredTerms);

console.log("\n=== UPDATE SECTIONS ===");
await updateSections(currentTerms);
await updateSections(filteredTerms);
} catch (error) {
console.error(error);

Expand Down

0 comments on commit 60c7803

Please sign in to comment.