Skip to content

Commit

Permalink
Fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Garcia committed Jun 7, 2023
1 parent c2c66ab commit 4e7cb65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
14 changes: 4 additions & 10 deletions pages/event/[event]/[match].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const QuestionRow = ({
}: {
question: FormQuestion;
value: any;
onChange: any;
onChange: (newVal: any) => void;
}) => {
return (
<div key={question.id} className="rounded-md w-full">
Expand All @@ -226,18 +226,14 @@ const QuestionRow = ({
<BooleanQuestion
question={question}
value={value}
onChange={(newVal) => {
onChange(newVal);
}}
onChange={onChange}
/>
)}
{question.type === "counter" && (
<CounterQuestion
question={question}
value={value}
onChange={(newVal) => {
onChange(newVal);
}}
onChange={onChange}
/>
)}
</div>
Expand Down Expand Up @@ -719,9 +715,7 @@ export default function MatchPage({
match={match}
teams={teamData}
selectedTeam={selectedTeam}
onChangeTeam={(team) => {
setSelectedTeam(team);
}}
onChangeTeam={setSelectedTeam}
/>

<ScoutForm selectedTeam={selectedTeam} />
Expand Down
29 changes: 15 additions & 14 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,20 @@ model ApiKey {
}

model Form {
id Int @id @default(autoincrement())
title String
year Int
description String?
questions FormQuestion[]
id Int @id @default(autoincrement())
title String
year Int
description String?
questions FormQuestion[]
}

model FormQuestion {
id Int @id @default(autoincrement())
title String
description String?
type String
required Boolean @default(false)
options String[]
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
formId Int
}
id Int @id @default(autoincrement())
title String
description String?
type String
required Boolean @default(false)
options String[]
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
formId Int
}

0 comments on commit 4e7cb65

Please sign in to comment.