protected shared
This commit is contained in:
parent
4125cd813b
commit
114486a78a
2 changed files with 5 additions and 1 deletions
|
|
@ -24,6 +24,10 @@ const VideoList: NextPage = () => {
|
||||||
const posthog = usePostHog();
|
const posthog = usePostHog();
|
||||||
const [, setRecordOpen] = useAtom(recordVideoModalOpen);
|
const [, setRecordOpen] = useAtom(recordVideoModalOpen);
|
||||||
|
|
||||||
|
if (status === "unauthenticated") {
|
||||||
|
void router.replace("/sign-in");
|
||||||
|
}
|
||||||
|
|
||||||
const { data: video, isLoading } = api.video.get.useQuery(
|
const { data: video, isLoading } = api.video.get.useQuery(
|
||||||
{ videoId },
|
{ videoId },
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ export const videoRouter = createTRPCRouter({
|
||||||
return videosWithThumbnailUrl;
|
return videosWithThumbnailUrl;
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
get: publicProcedure
|
get: protectedProcedure
|
||||||
.input(z.object({ videoId: z.string() }))
|
.input(z.object({ videoId: z.string() }))
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const { s3, posthog, session, prisma } = ctx;
|
const { s3, posthog, session, prisma } = ctx;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue