fix(rbooks): use imported randomUUID() instead of crypto.randomUUID()
crypto.randomUUID() crashes in the server context during demo space initialization, causing 502 Bad Gateway on /rbooks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fdf2a429f5
commit
a0723e261a
|
|
@ -407,7 +407,7 @@ function seedTemplateBooks(space: string) {
|
||||||
|
|
||||||
_syncServer.changeDoc<BooksCatalogDoc>(docId, 'seed template books', (d) => {
|
_syncServer.changeDoc<BooksCatalogDoc>(docId, 'seed template books', (d) => {
|
||||||
for (const b of books) {
|
for (const b of books) {
|
||||||
const id = crypto.randomUUID();
|
const id = randomUUID();
|
||||||
const slug = b.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
const slug = b.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
||||||
d.items[id] = {
|
d.items[id] = {
|
||||||
id, slug, title: b.title, author: b.author, description: b.desc,
|
id, slug, title: b.title, author: b.author, description: b.desc,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue