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
delete entiteis before publishing
awarm.space
3 months ago
563473b1
26488905
+9
-9
1 changed file
expand all
collapse all
unified
split
actions
publishToPublication.ts
+9
-9
actions/publishToPublication.ts
···
103
103
existingDocUri = draft?.document;
104
104
}
105
105
106
106
+
// Heuristic: Remove title entities if this is the first time publishing
107
107
+
// (when coming from a standalone leaflet with entitiesToDelete passed in)
108
108
+
if (entitiesToDelete && entitiesToDelete.length > 0 && !existingDocUri) {
109
109
+
await supabaseServerClient
110
110
+
.from("entities")
111
111
+
.delete()
112
112
+
.in("id", entitiesToDelete);
113
113
+
}
114
114
+
106
115
let { data } = await supabaseServerClient.rpc("get_facts", {
107
116
root: root_entity,
108
117
});
···
187
196
.eq("leaflet", leaflet_id)
188
197
.eq("publication", publication_uri),
189
198
]);
190
190
-
191
191
-
// Heuristic: Remove title entities if this is the first time publishing
192
192
-
// (when coming from a standalone leaflet with entitiesToDelete passed in)
193
193
-
if (entitiesToDelete && entitiesToDelete.length > 0 && !existingDocUri) {
194
194
-
await supabaseServerClient
195
195
-
.from("entities")
196
196
-
.delete()
197
197
-
.in("id", entitiesToDelete);
198
198
-
}
199
199
} else {
200
200
// Publishing standalone - update leaflets_to_documents
201
201
await supabaseServerClient.from("leaflets_to_documents").upsert({