diff --git a/package.json b/package.json index 7c0362ac..efcb5c1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.2.17", + "version": "1.2.18", "main": "index.ts", "license": "BUSL-1.1", "scripts": { diff --git a/src/models/user.ts b/src/models/user.ts index 5643e4ea..61489d49 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -370,6 +370,10 @@ export default class UserModel extends AbstractModel implements Us public async getWorkspacesIds(ids: (string | ObjectId)[] = []): Promise { const res = []; + if (ids.length === 0) { + return Object.keys(this.workspaces); + } + for (const id of ids) { const workspaceId = id.toString(); const workspace = this.workspaces[workspaceId];