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
27
pulls
pipelines
revert to old doc write flow
awarm.space
1 week ago
a54ab8c6
b53f1d98
+12
-2
1 changed file
expand all
collapse all
unified
split
app
api
inngest
functions
sync_document_metadata.ts
+12
-2
app/api/inngest/functions/sync_document_metadata.ts
···
39
});
40
if (!handleResult) return { error: "No Handle" };
41
0
0
0
0
0
0
0
0
0
0
42
await step.run("set-indexed", async () => {
43
return await supabaseServerClient
44
.from("documents")
45
-
.update({ indexed: !handleResult.isBridgy })
46
.eq("uri", document_uri)
47
.select();
48
});
49
50
-
if (!bsky_post_uri || handleResult.isBridgy) {
51
return { handle: handleResult.handle };
52
}
53
···
39
});
40
if (!handleResult) return { error: "No Handle" };
41
42
+
if (handleResult.isBridgy) {
43
+
await step.run("delete-bridgy-doc", async () => {
44
+
return await supabaseServerClient
45
+
.from("documents")
46
+
.delete()
47
+
.eq("uri", document_uri);
48
+
});
49
+
return { handle: handleResult.handle, deleted: true };
50
+
}
51
+
52
await step.run("set-indexed", async () => {
53
return await supabaseServerClient
54
.from("documents")
55
+
.update({ indexed: true })
56
.eq("uri", document_uri)
57
.select();
58
});
59
60
+
if (!bsky_post_uri) {
61
return { handle: handleResult.handle };
62
}
63