Skip to content

Commit 4eabb70

Browse files
committed
fix schedule and remove consoles
1 parent a40d747 commit 4eabb70

12 files changed

Lines changed: 12 additions & 23 deletions

File tree

‎frontend/main/src/components/ScheduleCards.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export default function ScheduleCards({
77
}: {
88
posts: Post[];
99
}): JSX.Element {
10-
console.log(posts);
1110
let re = /(\w+).null - /;
1211

1312
return (

‎frontend/main/src/components/SponsorCards.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default function SponsorCards({
66
}: {
77
sponsors: Sponsor[];
88
}): JSX.Element {
9-
console.log('sponsors', sponsors);
109
return (
1110
<div className="flex">
1211
<div className="rounded-md bg-basics-50 dark:bg-primary-800">

‎frontend/main/src/components/authors/Authors.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export default function Authors({
77
}: {
88
authors: Author[];
99
}): JSX.Element {
10-
console.log(authors);
1110
return (
1211
<section className="grid gap-4 justify-items-center">
1312
<section className="max-w-2xl text-center">

‎frontend/main/src/layout/PostLayout.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export default function PostLayout({
6969
setPlaying(false);
7070
setVideoProgress(0);
7171
setCurrentLesson(post.id);
72-
console.log('Reset');
7372
}, [post]);
7473

7574
function isLockedLesson() {

‎frontend/main/src/pages/authors/[authorPath].tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const getStaticPaths: GetStaticPaths = async () => {
3333
});
3434
}
3535
}
36-
console.log(paths);
3736
return {
3837
paths,
3938
fallback: true,

‎frontend/main/src/pages/authors/page/[pageNumber].tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export async function getStaticProps({
3333
}
3434
}
3535
}
36-
console.log('length', notionPosts?.results?.length);
3736
if (!notionPosts?.results?.length) {
3837
return {
3938
notFound: true,
@@ -55,7 +54,6 @@ export async function getStaticPaths() {
5554
const paths = sliceIntoChunks(raw.results, 20).map((_chunk, index) => ({
5655
params: { pageNumber: `${index + 1}` },
5756
}));
58-
console.log('paths', paths);
5957
return {
6058
paths,
6159
fallback: 'blocking',

‎frontend/main/src/pages/blog/page/[pageNumber].tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export async function getStaticProps({
3737
}
3838
}
3939
}
40-
console.log('length', notionPosts?.results?.length);
4140
if (!notionPosts?.results?.length) {
4241
return {
4342
notFound: true,
@@ -59,7 +58,6 @@ export async function getStaticPaths() {
5958
const paths = sliceIntoChunks(raw.results, 20).map((_chunk, index) => ({
6059
params: { pageNumber: `${index + 1}` },
6160
}));
62-
console.log('paths', paths);
6361
return {
6462
paths,
6563
fallback: 'blocking',

‎frontend/main/src/pages/courses/page/[pageNumber].tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export async function getStaticProps({
3737
}
3838
}
3939
}
40-
console.log('length', notionPosts?.results?.length);
4140
if (!notionPosts?.results?.length) {
4241
return {
4342
notFound: true,
@@ -59,7 +58,6 @@ export async function getStaticPaths() {
5958
const paths = sliceIntoChunks(raw.results, 20).map((_chunk, index) => ({
6059
params: { pageNumber: `${index + 1}` },
6160
}));
62-
console.log('paths', paths);
6361
return {
6462
paths,
6563
fallback: 'blocking',

‎frontend/main/src/pages/podcasts/page/[pageNumber].tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export async function getStaticProps({
3434
}
3535
}
3636
}
37-
console.log('length', notionPosts?.results?.length);
3837
if (!notionPosts?.results?.length) {
3938
return {
4039
notFound: true,

‎frontend/main/src/pages/schedule/[slug].tsx‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Post, PostType } from '@/models/post.model';
1010
import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next';
1111
import ScheduleUpper from '@/components/ScheduleUpper';
1212
import ScheduleCard from '@/components/ScheduleCard';
13+
import DefaultErrorPage from 'next/error';
1314

1415
interface StaticParams {
1516
site: Site;
@@ -47,14 +48,10 @@ export const getStaticProps: GetStaticProps<StaticParams> = async ({
4748
};
4849
}
4950
const site = getSite();
50-
const scheduled = await queryPurrfectStreamByScheduled(
51-
undefined,
52-
undefined,
53-
slug
54-
);
55-
const post = scheduled?.results?.at(0) || null;
51+
const scheduled = await queryPurrfectStreamByScheduled(1, undefined, slug);
52+
const post = scheduled?.results?.at(0);
5653

57-
if (!post) {
54+
if (!post || !scheduled?.results?.length) {
5855
console.log('Schedule not found');
5956
return {
6057
notFound: true,
@@ -69,10 +66,17 @@ export const getStaticProps: GetStaticProps<StaticParams> = async ({
6966
};
7067
};
7168

72-
export default function AuthorPage({
69+
export default function SchedulePage({
7370
site,
7471
post,
7572
}: InferGetStaticPropsType<typeof getStaticProps>) {
73+
if (!post) {
74+
return (
75+
<Layout site={site}>
76+
<DefaultErrorPage statusCode={404} />
77+
</Layout>
78+
);
79+
}
7680
return (
7781
<>
7882
<NextSeo

0 commit comments

Comments
 (0)