Skip to content

Commit b81b5a8

Browse files
committed
Fix TS
1 parent 8ffc8f5 commit b81b5a8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/database.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ export class Database {
13551355
path: "/_api/database",
13561356
body: { name: databaseName, users, options },
13571357
},
1358-
() => new Database(this, databaseName)
1358+
() => this.database(databaseName)
13591359
);
13601360
}
13611361

@@ -1413,7 +1413,9 @@ export class Database {
14131413
*/
14141414
databases(): Promise<Database[]> {
14151415
return this.request({ path: "/_api/database" }, (res) =>
1416-
(res.body.result as string[]).map((name) => new Database(this, name))
1416+
(res.body.result as string[]).map((databaseName) =>
1417+
this.database(databaseName)
1418+
)
14171419
);
14181420
}
14191421

@@ -1433,7 +1435,9 @@ export class Database {
14331435
*/
14341436
userDatabases(): Promise<Database[]> {
14351437
return this.request({ path: "/_api/database/user" }, (res) =>
1436-
(res.body.result as string[]).map((name) => new Database(this, name))
1438+
(res.body.result as string[]).map((databaseName) =>
1439+
this.database(databaseName)
1440+
)
14371441
);
14381442
}
14391443

0 commit comments

Comments
 (0)