tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
add all leaflets feed
awarm.space
5 months ago
78088053
b535116e
+21
-10
1 changed file
expand all
collapse all
unified
split
feeds
index.ts
+21
-10
feeds/index.ts
···
63
63
.eq(
64
64
"documents_in_publications.publications.identities.bsky_follows.identity",
65
65
auth,
66
66
+
);
67
67
+
} else if (feedAtURI.rkey === "all-leaflets") {
68
68
+
query = supabaseServerClient
69
69
+
.from("documents")
70
70
+
.select(
71
71
+
`*,
72
72
+
documents_in_publications!inner(publications!inner(*))`,
66
73
)
67
67
-
.not("data -> postRef", "is", null)
68
68
-
.order("indexed_at", { ascending: false })
69
69
-
.limit(25);
74
74
+
.or(
75
75
+
"record->preferences->showInDiscover.is.null,record->preferences->>showInDiscover.eq.true",
76
76
+
{ referencedTable: "documents_in_publications.publications" },
77
77
+
);
70
78
} else {
79
79
+
//the default subscription feed
71
80
query = supabaseServerClient
72
81
.from("documents")
73
82
.select(
···
77
86
.eq(
78
87
"documents_in_publications.publications.publication_subscriptions.identity",
79
88
auth,
80
80
-
)
81
81
-
.not("data -> postRef", "is", null)
82
82
-
.order("indexed_at", { ascending: false })
83
83
-
.order("uri", { ascending: false })
84
84
-
.limit(25);
89
89
+
);
85
90
}
91
91
+
query = query
92
92
+
.not("data -> postRef", "is", null)
93
93
+
.order("indexed_at", { ascending: false })
94
94
+
.order("uri", { ascending: false })
95
95
+
.limit(25);
86
96
if (parsedCursor)
87
87
-
query.or(
97
97
+
query = query.or(
88
98
`indexed_at.lt.${parsedCursor.date},and(indexed_at.eq.${parsedCursor.date},uri.lt.${parsedCursor.uri})`,
89
99
);
90
100
91
91
-
let { data } = await query;
101
101
+
let { data, error } = await query;
102
102
+
console.log(error);
92
103
posts = data;
93
104
94
105
posts = posts || [];