Merge branch 'dev'
This commit is contained in:
commit
451801d12c
|
|
@ -842,6 +842,8 @@ routes.get("/api/context/:tool", async (c) => {
|
|||
routes.get("/", (c) => {
|
||||
const space = c.req.param("space") || "demo";
|
||||
const dataSpace = c.get("effectiveSpace") || space;
|
||||
// Seed sample data for any space that has no events yet
|
||||
seedDemoIfEmpty(dataSpace);
|
||||
return c.html(renderShell({
|
||||
title: `${space} — Calendar | rSpace`,
|
||||
moduleId: "rcal",
|
||||
|
|
|
|||
|
|
@ -176,6 +176,17 @@ export async function createSpace(opts: CreateSpaceOpts): Promise<CreateSpaceRes
|
|||
console.error(`[createSpace:${source}] Template seeding failed for ${slug}:`, e);
|
||||
}
|
||||
|
||||
// Seed module-specific demo data (calendar events, sample tasks, etc.)
|
||||
for (const mod of getAllModules()) {
|
||||
if (mod.seedTemplate) {
|
||||
try {
|
||||
mod.seedTemplate(slug);
|
||||
} catch (e) {
|
||||
console.error(`[createSpace:${source}] Module ${mod.id} seedTemplate failed for ${slug}:`, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`[createSpace:${source}] Created space: ${slug}`);
|
||||
return { ok: true, slug, name, visibility, ownerDID };
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue