Skip to content

Commit

Permalink
db-work: fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
konstrybakov committed Oct 6, 2024
1 parent 39bf6db commit c5c3c3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PracticeCard = ({ children, word }: PracticeCardProps) => {
async (grade: Grade) => {
await processPracticeAttempt(
input === skippedInput || input === emptyInput ? null : input,
Number(params.wordId),
params.wordId,
grade,
params.sessionId,
)
Expand Down
2 changes: 1 addition & 1 deletion app/practice/session/[sessionId]/[wordId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function WordPracticePage({

const word = await prisma.word.findUnique({
where: {
id: Number(wordId),
id: wordId,
},
...WordForPracticeArgs,
})
Expand Down
3 changes: 2 additions & 1 deletion app/words/_actions/delete-word.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import { prisma } from '@/lib/db/client'
import { SELECT_NONE } from '@/lib/db/select-none'
import type { Word } from '@prisma/client'

import 'server-only'

export const deleteWord = async (id: number) => {
export const deleteWord = async (id: Word['id']) => {
'use server'

const result = await prisma.word.delete({
Expand Down

0 comments on commit c5c3c3b

Please sign in to comment.