Skip to content

Commit ae63f89

Browse files
committed
patch
1 parent c5fae6b commit ae63f89

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/create-collection.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ const GET_COLLECTION = (id) => {
3131
return collection;
3232
};
3333

34-
const DATABASE_ID = '64c4de8e7b30179809ef';
34+
const GET_DATABASE_ID = () => {
35+
const databese = schema.databases[0];
36+
if (!databese) {
37+
throw new Error(`database not found: ${id}`);
38+
}
39+
return databese.$id;
40+
};
41+
42+
const DATABASE_ID = GET_DATABASE_ID();
3543

3644
const client = new sdk.Client();
3745
const databases = new sdk.Databases(client);

0 commit comments

Comments
 (0)