Skip to content

Commit 6ef4eca

Browse files
committed
add published start filter
1 parent 139c43a commit 6ef4eca

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

backend/firebase/functions/src/utilities/notion.server.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export const getAuthorBySlugService = async ({
109109
equals: 'published',
110110
},
111111
},
112+
{
113+
property: 'start',
114+
date: {
115+
on_or_before: new Date().toISOString(),
116+
},
117+
},
112118
],
113119
},
114120
});
@@ -342,6 +348,12 @@ export const queryByPublished = async (
342348
equals: 'published',
343349
},
344350
},
351+
{
352+
property: 'start',
353+
date: {
354+
on_or_before: new Date().toISOString(),
355+
},
356+
},
345357
],
346358
};
347359

@@ -490,6 +502,12 @@ export const queryNotionDbBySlug = async (
490502
equals: 'published',
491503
},
492504
},
505+
{
506+
property: 'start',
507+
date: {
508+
on_or_before: new Date().toISOString(),
509+
},
510+
},
493511
],
494512
],
495513
};
@@ -552,6 +570,12 @@ export const querySectionsByCourseId = async (
552570
},
553571
},
554572
},
573+
{
574+
property: 'start',
575+
date: {
576+
on_or_before: new Date().toISOString(),
577+
},
578+
},
555579
],
556580
};
557581
}

frontend/main/src/services/notion.server.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ export const getAuthorBySlugService = async ({
9191
equals: 'published',
9292
},
9393
},
94+
{
95+
property: 'start',
96+
date: {
97+
on_or_before: new Date().toISOString(),
98+
},
99+
},
94100
],
95101
},
96102
});
@@ -382,6 +388,12 @@ export const queryByPublished = async (
382388
equals: 'published',
383389
},
384390
},
391+
{
392+
property: 'start',
393+
date: {
394+
on_or_before: new Date().toISOString(),
395+
},
396+
},
385397
],
386398
};
387399

@@ -486,6 +498,12 @@ export const queryNotionDbBySlug = async (
486498
equals: 'published',
487499
},
488500
},
501+
{
502+
property: 'start',
503+
date: {
504+
on_or_before: new Date().toISOString(),
505+
},
506+
},
489507
],
490508
],
491509
};
@@ -585,6 +603,12 @@ export const querySectionsByCourseId = async (
585603
},
586604
},
587605
},
606+
{
607+
property: 'start',
608+
date: {
609+
on_or_before: new Date().toISOString(),
610+
},
611+
},
588612
],
589613
};
590614
}

0 commit comments

Comments
 (0)