Skip to content

Commit

Permalink
fix: blocked users no longer show in followers (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
capJavert authored Jan 14, 2025
1 parent 3595236 commit 7042f8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
31 changes: 2 additions & 29 deletions __tests__/contentPreference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('query userFollowers', () => {
feedId: '4-ufq',
referenceId: '1-ufq',
referenceUserId: '1-ufq',
status: ContentPreferenceStatus.Follow,
status: ContentPreferenceStatus.Blocked,
createdAt: new Date(now.getTime() - 4000),
},
]);
Expand Down Expand Up @@ -282,15 +282,6 @@ describe('query userFollowers', () => {
},
},
},
{
node: {
referenceId: '1-ufq',
status: 'follow',
user: {
id: '4-ufq',
},
},
},
],
},
});
Expand Down Expand Up @@ -386,7 +377,7 @@ describe('query userFollowing', () => {
feedId: '1-ufwq',
referenceId: '4-ufwq',
referenceUserId: '4-ufwq',
status: ContentPreferenceStatus.Follow,
status: ContentPreferenceStatus.Blocked,
createdAt: new Date(now.getTime() - 4000),
},
]);
Expand Down Expand Up @@ -424,15 +415,6 @@ describe('query userFollowing', () => {
},
},
},
{
node: {
referenceId: '4-ufwq',
status: 'follow',
user: {
id: '1-ufwq',
},
},
},
],
},
});
Expand Down Expand Up @@ -469,15 +451,6 @@ describe('query userFollowing', () => {
},
},
},
{
node: {
referenceId: '4-ufwq',
status: 'follow',
user: {
id: '1-ufwq',
},
},
},
],
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/schema/contentPreference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ export const resolvers: IResolvers<unknown, BaseContext> = traceResolvers<
.andWhere(`${builder.alias}."type" = :type`, {
type: args.entity,
})
.andWhere(`${builder.alias}."status" != :status`, {
status: ContentPreferenceStatus.Blocked,
})
.limit(page.limit)
.offset(page.offset)
.addOrderBy(`${builder.alias}."createdAt"`, 'DESC');
Expand Down

0 comments on commit 7042f8c

Please sign in to comment.