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 VideoList: NextPage = () => {
|
||||||
const router = useRouter();
|
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);
|
console.log(video);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export const videoRouter = createTRPCRouter({
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const video = await ctx.prisma.video.findUnique({
|
const video = await ctx.prisma.video.findUnique({
|
||||||
where: {
|
where: {
|
||||||
videoId: input.videoId,
|
id: input.videoId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return video;
|
return video;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue