File tree Expand file tree Collapse file tree 1 file changed +45
-6
lines changed
frontend/main/src/services Expand file tree Collapse file tree 1 file changed +45
-6
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,22 @@ export const queryRelationById = async (
633
633
direction : 'descending' ,
634
634
} ,
635
635
] ;
636
+ let filter : any = {
637
+ and : [
638
+ {
639
+ property : relation ,
640
+ relation : {
641
+ contains : id ,
642
+ } ,
643
+ } ,
644
+ {
645
+ property : 'published' ,
646
+ select : {
647
+ equals : 'published' ,
648
+ } ,
649
+ } ,
650
+ ] ,
651
+ } ;
636
652
637
653
if ( _type == PostType . podcast ) {
638
654
sorts = [
@@ -645,6 +661,34 @@ export const queryRelationById = async (
645
661
direction : 'descending' ,
646
662
} ,
647
663
] ;
664
+ filter = {
665
+ and : [
666
+ {
667
+ property : 'slug' ,
668
+ url : {
669
+ is_not_empty : true ,
670
+ } ,
671
+ } ,
672
+ {
673
+ property : 'Status' ,
674
+ select : {
675
+ equals : 'Released' ,
676
+ } ,
677
+ } ,
678
+ {
679
+ property : 'Episode' ,
680
+ number : {
681
+ is_not_empty : true ,
682
+ } ,
683
+ } ,
684
+ {
685
+ property : 'start' ,
686
+ date : {
687
+ on_or_before : new Date ( ) . toISOString ( ) ,
688
+ } ,
689
+ } ,
690
+ ] ,
691
+ } ;
648
692
}
649
693
if ( skipNotion ) {
650
694
return {
@@ -655,12 +699,7 @@ export const queryRelationById = async (
655
699
let raw = await notionClient . databases . query ( {
656
700
database_id : getNotionDbByType ( _type ) ,
657
701
page_size : 20 , // Adding this so that Algolia is used more
658
- filter : {
659
- property : relation ,
660
- relation : {
661
- contains : id ,
662
- } ,
663
- } ,
702
+ filter,
664
703
sorts,
665
704
} ) ;
666
705
return await formatPosts ( raw , _type ) ;
You can’t perform that action at this time.
0 commit comments