Skip to content

Commit

Permalink
working on buld errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBoyett committed Feb 16, 2024
1 parent 89698ab commit ed23a7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions apps/nextjs/src/components/speedtest.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useState } from 'react'
import useInterval from '../hooks/useInterval'
import type { SpeedQuestion } from '@prisma/client'
import type { SpeedTest } from '@acme/types'
import type { User } from '@acme/types'
import { trpc } from '../utils/trpc'
import useUserStore from '../stores/userStore'
import { type SingletonRouter, useRouter } from 'next/router'
import { formatDate, navigate } from '@acme/helpers'

type QuestionViewProps = {
speedQuestion: SpeedQuestion
speedQuestion: SpeedTest
user: User | undefined
doneSignal: () => void
}
Expand Down Expand Up @@ -44,7 +44,7 @@ function AnswerView({
speedQuestion,
user,
}: {
speedQuestion: SpeedQuestion
speedQuestion: SpeedTest
user: User | undefined
}) {
const { mutate } = trpc.user.set.useMutation()
Expand Down Expand Up @@ -175,7 +175,7 @@ export default function SpeedTest({
speedQuestion,
}: {
user: User | undefined
speedQuestion: SpeedQuestion
speedQuestion: SpeedTest
}) {
const [isAnswerTime, setIsAnswerTime] = useState(false)
return (
Expand Down
8 changes: 5 additions & 3 deletions packages/api/src/router/exercises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
wordPairData,
wordPairProps,
} from '@acme/validators'
import { Prisma, type SpeedQuestion, type WordPair } from '@acme/db'
import { Prisma, type WordPair } from '@acme/db'
import { SpeedTest } from '@acme/types'
import { getNextExercise, getNextURL } from '@acme/helpers'

const multiTest = speedTestSchema.array()
Expand Down Expand Up @@ -144,14 +145,15 @@ export const excercisePropsRouter = router({
const randomNumbers = numbers
.sort(() => Math.random() - Math.random())
.slice(0, input)
const result = Array<SpeedQuestion>()
const result = Array<SpeedTest>()
for (let i = 0; i < input; i++) {
const question = await ctx.prisma.speedQuestion.findUnique({
where: {
id: randomNumbers[i],
},
})
if (question === null || question === undefined) throw new Error('No result')
if (question === null || question === undefined)
throw new Error('No result')
result.push(question)
}
if (result === null || result === undefined) throw new Error('No result')
Expand Down

0 comments on commit ed23a7c

Please sign in to comment.