Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/types/quizzes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export interface BaseQuestion extends Record<string, any> {
export interface FilterValueQuestion extends BaseQuestion {
type: 'single_filter_value' |'multiple_filter_values';
filter_name: string;
options: QuestionOption[];
options: FilterQuestionOption[];
}

export interface SelectQuestion extends BaseQuestion {
Expand All @@ -159,8 +159,7 @@ export interface QuizResult extends Record<string, any> {
results_url: string;
}

export interface QuestionOption extends Record<string, any> {
id: number;
export interface BaseQuestionOption {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the name. Is there a reason why this is not extending Record<string, any> anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just removed it since I did not see any usefulness of it
Can add it back if you have strong opinion on that

value: string;
attribute: Nullable<{
name: string;
Expand All @@ -169,6 +168,14 @@ export interface QuestionOption extends Record<string, any> {
images?: Nullable<QuestionImages>;
}

export interface QuestionOption extends BaseQuestionOption {
id: number;
}

export interface FilterQuestionOption extends BaseQuestionOption {
id: string;
}

export interface QuestionImages extends Record<string, any> {
primary_url?: Nullable<string>;
primary_alt?: Nullable<string>;
Expand Down
Loading