Skip to content

Commit

Permalink
delete duplicate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabeth-tang committed Oct 22, 2023
1 parent c00446a commit d51cd00
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/global-firestore-data/user-semesters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,10 @@ export const addSemester = (
editSemesters(plan, oldSemesters => [...oldSemesters, createSemester(year, season, courses)]);
};

export const addPlan = async (name: string, semesters: FirestoreSemester[]): Promise<void> => {
await editPlans(oldPlans => [...oldPlans, createPlan(name, semesters)]);
};

export const addPlan = async (
name: string,
semesters: FirestoreSemester[],
gtag?: GTag
gtag?: VueGtag
): Promise<void> => {
GTagEvent(gtag, 'add-plan');
await editPlans(oldPlans => [...oldPlans, createPlan(name, semesters)]);
Expand All @@ -129,13 +125,7 @@ export const deleteSemester = (
}
};

export const deletePlan = async (name: string): Promise<void> => {
if (store.state.plans.some(p => p.name === name)) {
await editPlans(oldPlans => oldPlans.filter(p => p.name !== name));
}
};

export const deletePlan = async (name: string, gtag?: GTag): Promise<void> => {
export const deletePlan = async (name: string, gtag?: VueGtag): Promise<void> => {
GTagEvent(gtag, 'delete-plan');
if (store.state.plans.some(p => p.name === name)) {
await editPlans(oldPlans => oldPlans.filter(p => p.name !== name));
Expand Down

0 comments on commit d51cd00

Please sign in to comment.