Skip to content

Commit

Permalink
refactor: 기존 conditionCheckers 선언 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
flydog98 authored and LuizyHub committed Dec 4, 2023
1 parent d12d6ec commit 4f3aa5e
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions packages/backend/src/quiz-wizard/quiz-wizard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,8 @@ import { Magic } from './magic';
export class QuizWizardService {
constructor(private magic: Magic) {}

private conditionCheckers = {
1: (containerId: string) => this.checkCondition1(containerId),
2: (containerId: string) => this.checkCondition2(containerId),
3: (containerId: string) => this.checkCondition3(containerId),
4: (containerId: string) => this.checkCondition4(containerId),
5: (containerId: string) => this.checkCondition5(containerId),
6: (containerId: string) => this.checkCondition6(containerId),
7: (containerId: string) => this.checkCondition7(containerId),
8: (containerId: string) => this.checkCondition8(containerId),
9: (containerId: string) => this.checkCondition9(containerId),
10: (containerId: string) => this.checkCondition10(containerId),
11: (containerId: string) => this.checkCondition11(containerId),
12: (containerId: string) => this.checkCondition12(containerId),
13: (containerId: string) => this.checkCondition13(containerId),
15: (containerId: string) => this.checkCondition15(containerId),
16: (containerId: string) => this.checkCondition16(containerId),
17: (containerId: string) => this.checkCondition17(containerId),
19: (containerId: string) => this.checkCondition19(containerId),
};

async submit(containerId: string, quizId: number) {
const checker = this.conditionCheckers[quizId];
const checker = this[`checkCondition${quizId}`];
if (checker) {
return await checker(containerId);
}
Expand Down

0 comments on commit 4f3aa5e

Please sign in to comment.