Skip to content

Commit

Permalink
[bugfix] get community (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Pedro da Silva authored Nov 21, 2023
1 parent 7d2e84a commit 459aeaa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/api/src/controllers/v2/community/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,19 @@ class CommunityController {
.then(community => standardResponse(res, 200, !!community, community))
.catch(e => standardResponse(res, 400, false, '', { error: e }));
} else {
const communityId = parseInt(idOrAddress, 10);
if (!communityId) {
standardResponse(res, 400, false, '', {
error: {
name: 'INVALID_PARAMS',
message: 'community ID or address is expected'
}
});
return;
}

this.detailsService
.findById(parseInt(idOrAddress, 10), req.user?.address, req.query)
.findById(communityId, req.user?.address, req.query)
.then(community => standardResponse(res, 200, true, community))
.catch(e => standardResponse(res, 400, false, '', { error: e }));
}
Expand Down

0 comments on commit 459aeaa

Please sign in to comment.