fix typescript errors
This commit is contained in:
parent
435f9b2d7d
commit
b335f4acd4
2 changed files with 8 additions and 3 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue