diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-05-19 23:29:28 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-05-19 23:29:28 +0900 |
| commit | 7732aabc1ea25cf8da848d8b5193e73af67a2305 (patch) | |
| tree | fbcdaaf4ba07e4053c5a32fefb4bed350424f181 /src/server/api | |
| parent | 11.17.0 (diff) | |
| download | sharkey-7732aabc1ea25cf8da848d8b5193e73af67a2305.tar.gz sharkey-7732aabc1ea25cf8da848d8b5193e73af67a2305.tar.bz2 sharkey-7732aabc1ea25cf8da848d8b5193e73af67a2305.zip | |
Fix bug
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/endpoints/users/groups/joined.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/api/endpoints/users/groups/joined.ts b/src/server/api/endpoints/users/groups/joined.ts index 853a2510de..97d168e527 100644 --- a/src/server/api/endpoints/users/groups/joined.ts +++ b/src/server/api/endpoints/users/groups/joined.ts @@ -32,7 +32,9 @@ export default define(meta, async (ps, me) => { const joinings = await UserGroupJoinings.find({ userId: me.id, - userGroupId: Not(In(ownedGroups.map(x => x.id))) + ...(ownedGroups.length > 0 ? { + userGroupId: Not(In(ownedGroups.map(x => x.id))) + } : {}) }); return await Promise.all(joinings.map(x => UserGroups.pack(x.userGroupId))); |