Skip to content

Commit

Permalink
fixed_some_types
Browse files Browse the repository at this point in the history
  • Loading branch information
mynotdoing committed Nov 17, 2023
1 parent 1ef155d commit c6b3e82
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const defaultResponse = {
description: '',
items: [],
author: { _id: '' },
category: '',
category: null,
createdAt: '',
updatedAt: ''
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const CreateOrEditQuizContainer = ({
_: React.SyntheticEvent,
value: Category | null
) => {
setCategory(value?._id ?? '')
setCategory(value?._id ?? null)
}

const handleResponse = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/new-quiz/NewQuiz.constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export interface QuizContentProps {
setDescription: Dispatch<SetStateAction<CreateQuizParams['description']>>
questions: Question[]
setQuestions: Dispatch<SetStateAction<Question[]>>
category: string
setCategory: Dispatch<SetStateAction<string>>
category: string | null
setCategory: Dispatch<SetStateAction<string | null>>
}

export interface QuizTabsData {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/new-quiz/NewQuiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const NewQuiz = () => {
const [questions, setQuestions] = useState<Question[]>([])
const [title, setTitle] = useState<string>('')
const [description, setDescription] = useState<string>('')
const [category, setCategory] = useState<string>('')
const [category, setCategory] = useState<string | null>(null)

const handleClick = (tab: string) => {
setActiveTab(tab)
Expand Down
4 changes: 2 additions & 2 deletions src/types/quizzes/interfaces/quizzes.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export interface Quiz extends CommonEntityFields {
title: string
items: QuestionWithAnswers[]
author: Pick<UserResponse, '_id'>
category: string
category: string | null
}

export interface CreateQuizParams {
title: string
description: string
items: Question[]
category: string
category: string | null
}

0 comments on commit c6b3e82

Please sign in to comment.