fix typescript errors

This commit is contained in:
MarconLP 2023-04-11 11:35:15 +02:00
parent 435f9b2d7d
commit b335f4acd4
No known key found for this signature in database
GPG key ID: F4CAFFDFA3451D5E
2 changed files with 8 additions and 3 deletions

View file

@ -8,9 +8,14 @@ import Link from "next/link";
const VideoList: NextPage = () => {
const router = useRouter();
const { videoId } = router.query;
const { videoId } = router.query as { videoId: string };
const video = api.video.get.useQuery({ videoId });
const video = api.video.get.useQuery(
{ videoId },
{
enabled: router.isReady,
}
);
console.log(video);
return (

View file

@ -15,7 +15,7 @@ export const videoRouter = createTRPCRouter({
.query(async ({ ctx, input }) => {
const video = await ctx.prisma.video.findUnique({
where: {
videoId: input.videoId,
id: input.videoId,
},
});
return video;