Skip to content

Commit

Permalink
feat: filter private community
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz committed Mar 23, 2024
1 parent 7f1b160 commit 914d04b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/dto/output/community.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export interface Community {
id: string;
ownerId: string;
private: boolean;
premium: boolean;
name?: string;
image?: string;
description?: string;
longDescription?: string;
members?: number;
}
10 changes: 6 additions & 4 deletions src/services/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ export class UsersService {

return {
id: user.data.id,
communities: communities.data.map( (e: Community) => {
communities: communities.data.filter( (e: Community) => !e.private).map( (e: Community) => {
return {
id: e.id,
ownerId: e.ownerId,
name: "REDACTED",
description: "REDACTED",
image: "REDACTED",
premium: e.premium,
name: e.name,
description: e.description,
longDescription: e.longDescription,
image: e.image,
members: e.members,
};
} ),
Expand Down

0 comments on commit 914d04b

Please sign in to comment.