This commit is contained in:
@@ -44,21 +44,21 @@ export const up = async () => {
|
||||
for (const [dbName, dbSecurity] of Object.entries(dbsSecurity)) {
|
||||
const responseCreateDb = await fetch(`${process.env.API_URL}/${dbName}`, {
|
||||
method: "PUT",
|
||||
});
|
||||
}).then((response) => response.json());
|
||||
|
||||
console.assert(
|
||||
(await responseCreateDb.json()).ok,
|
||||
`${dbName} create db error`,
|
||||
responseCreateDb.ok,
|
||||
`${dbName} create db error ${JSON.stringify(responseCreateDb)}`,
|
||||
);
|
||||
const responseSetSecurity = await fetch(
|
||||
`${process.env.API_URL}/${dbName}/_security`,
|
||||
{
|
||||
|
||||
const responseSetSecurity = await fetch(`${process.env.API_URL}/${dbName}/_security`, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(dbSecurity),
|
||||
},
|
||||
);
|
||||
}).then((response) => response.json());
|
||||
|
||||
console.assert(
|
||||
(await responseSetSecurity.json()).ok,
|
||||
`${dbName} security error`,
|
||||
responseSetSecurity.ok,
|
||||
`${dbName} security error ${JSON.stringify(responseSetSecurity)}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user