Performance and layout enhancements

This commit is contained in:
2026-04-10 13:19:51 -07:00
parent d51eef4d42
commit 215ead0768
6 changed files with 694 additions and 280 deletions
+26
View File
@@ -278,6 +278,32 @@ export const buildServer = async () => {
service: "api"
}));
app.get("/api/admin/bootstrap", async () => store.read());
app.get("/api/admin/live", async () => {
const state = await store.read();
const pendingCount = state.photoAssets.filter((asset) => {
if (asset.moderationStatus !== "pending") {
return false;
}
const submission = state.submissions.find((entry) => entry.id === asset.submissionId);
return submission?.source !== "admin_upload";
}).length;
return {
cues: state.cues,
pendingCount,
approvedCount: state.photoAssets.filter((asset) => asset.moderationStatus === "approved").length
};
});
app.get("/api/admin/library", async () => {
const state = await store.read();
return {
photoAssets: state.photoAssets,
submissions: state.submissions,
collections: state.collections
};
});
app.get("/api/state", async () => store.read());
app.get("/api/scenes", async () => (await store.read()).scenes);
app.get("/api/cues", async () => (await store.read()).cues);