Skip to content

Commit 17be2b0

Browse files
authored
Merge pull request #580 from codex-team/feat/user-workspaces
fix(users): return all users workspaces if no ids
2 parents c83c288 + b48a26e commit 17be2b0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hawk.api",
3-
"version": "1.2.17",
3+
"version": "1.2.18",
44
"main": "index.ts",
55
"license": "BUSL-1.1",
66
"scripts": {

src/models/user.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ export default class UserModel extends AbstractModel<UserDBScheme> implements Us
370370
public async getWorkspacesIds(ids: (string | ObjectId)[] = []): Promise<string[]> {
371371
const res = [];
372372

373+
if (ids.length === 0) {
374+
return Object.keys(this.workspaces);
375+
}
376+
373377
for (const id of ids) {
374378
const workspaceId = id.toString();
375379
const workspace = this.workspaces[workspaceId];

0 commit comments

Comments
 (0)