a tool for shared writing and social publishing

add all leaflets feed

+21 -10
+21 -10
feeds/index.ts
··· 63 .eq( 64 "documents_in_publications.publications.identities.bsky_follows.identity", 65 auth, 66 ) 67 - .not("data -> postRef", "is", null) 68 - .order("indexed_at", { ascending: false }) 69 - .limit(25); 70 } else { 71 query = supabaseServerClient 72 .from("documents") 73 .select( ··· 77 .eq( 78 "documents_in_publications.publications.publication_subscriptions.identity", 79 auth, 80 - ) 81 - .not("data -> postRef", "is", null) 82 - .order("indexed_at", { ascending: false }) 83 - .order("uri", { ascending: false }) 84 - .limit(25); 85 } 86 if (parsedCursor) 87 - query.or( 88 `indexed_at.lt.${parsedCursor.date},and(indexed_at.eq.${parsedCursor.date},uri.lt.${parsedCursor.uri})`, 89 ); 90 91 - let { data } = await query; 92 posts = data; 93 94 posts = posts || [];
··· 63 .eq( 64 "documents_in_publications.publications.identities.bsky_follows.identity", 65 auth, 66 + ); 67 + } else if (feedAtURI.rkey === "all-leaflets") { 68 + query = supabaseServerClient 69 + .from("documents") 70 + .select( 71 + `*, 72 + documents_in_publications!inner(publications!inner(*))`, 73 ) 74 + .or( 75 + "record->preferences->showInDiscover.is.null,record->preferences->>showInDiscover.eq.true", 76 + { referencedTable: "documents_in_publications.publications" }, 77 + ); 78 } else { 79 + //the default subscription feed 80 query = supabaseServerClient 81 .from("documents") 82 .select( ··· 86 .eq( 87 "documents_in_publications.publications.publication_subscriptions.identity", 88 auth, 89 + ); 90 } 91 + query = query 92 + .not("data -> postRef", "is", null) 93 + .order("indexed_at", { ascending: false }) 94 + .order("uri", { ascending: false }) 95 + .limit(25); 96 if (parsedCursor) 97 + query = query.or( 98 `indexed_at.lt.${parsedCursor.date},and(indexed_at.eq.${parsedCursor.date},uri.lt.${parsedCursor.uri})`, 99 ); 100 101 + let { data, error } = await query; 102 + console.log(error); 103 posts = data; 104 105 posts = posts || [];