tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
a tool for shared writing and social publishing
284
fork
atom
overview
issues
27
pulls
pipelines
fix bsky post indexing function
awarm.space
6 days ago
4ba387ab
81a61895
+12
-3
1 changed file
expand all
collapse all
unified
split
app
api
inngest
functions
index_post_mention.ts
+12
-3
app/api/inngest/functions/index_post_mention.ts
···
3
3
import { AtpAgent, AtUri } from "@atproto/api";
4
4
import { Json } from "supabase/database.types";
5
5
import { ids } from "lexicons/api/lexicons";
6
6
-
import { Notification, pingIdentityToUpdateNotification } from "src/notifications";
6
6
+
import {
7
7
+
Notification,
8
8
+
pingIdentityToUpdateNotification,
9
9
+
} from "src/notifications";
7
10
import { v7 } from "uuid";
8
11
import { idResolver } from "app/(home-pages)/reader/idResolver";
9
12
import { documentUriFilter } from "src/utils/uriHelpers";
···
60
63
let { data: pub, error } = await supabaseServerClient
61
64
.from("publications")
62
65
.select("*")
63
63
-
.or(`record->>base_path.eq.${url.host},record->>url.eq.https://${url.host}`)
66
66
+
.or(
67
67
+
`record->>base_path.eq.${url.host},record->>url.eq.https://${url.host}`,
68
68
+
)
69
69
+
.order("uri", { ascending: false })
70
70
+
.limit(1)
64
71
.single();
65
72
66
73
if (!pub) {
···
80
87
const docData = docDataArr?.[0];
81
88
82
89
if (!docData) {
83
83
-
return { message: `No document found for publication ${url.host}/${path[0]}` };
90
90
+
return {
91
91
+
message: `No document found for publication ${url.host}/${path[0]}`,
92
92
+
};
84
93
}
85
94
86
95
documentUri = docData.uri;