Skip to content

Commit

Permalink
fix: timeline filter (#844)
Browse files Browse the repository at this point in the history
Co-authored-by: Abdul Hakim <[email protected]>
  • Loading branch information
abdulhakim2902 and abdulhakim2902 authored Apr 13, 2023
1 parent f8b9ab5 commit 7642891
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/services/filter-builder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,6 @@ export class FilterBuilderService {
{tags: {nin: prohibitedTags}} as Where,
{createdBy: {nin: blocked}},
{visibility: VisibilityType.PUBLIC},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
{
Expand All @@ -1460,15 +1459,13 @@ export class FilterBuilderService {
{tags: {nin: prohibitedTags}} as Where,
{createdBy: {nin: blocked}},
{visibility: VisibilityType.PUBLIC},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
{
and: [
{tags: {nin: prohibitedTags}} as Where,
{createdBy: {inq: experienceUserIds}},
{visibility: VisibilityType.PUBLIC},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
// Visibility SELECTED USER
Expand All @@ -1488,7 +1485,6 @@ export class FilterBuilderService {
{createdBy: {nin: blocked}},
{selectedUserIds: {inq: [this.currentUser[securityId]]}},
{visibility: VisibilityType.SELECTED},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
{
Expand All @@ -1498,7 +1494,6 @@ export class FilterBuilderService {
{createdBy: {nin: blocked}},
{selectedUserIds: {inq: [this.currentUser[securityId]]}},
{visibility: VisibilityType.SELECTED},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
// Visibility FRIEND
Expand All @@ -1516,7 +1511,6 @@ export class FilterBuilderService {
{tags: {nin: prohibitedTags}} as Where,
{createdBy: {inq: expFriendIds}},
{visibility: VisibilityType.FRIEND},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
{
Expand All @@ -1525,7 +1519,6 @@ export class FilterBuilderService {
{tags: {nin: prohibitedTags}} as Where,
{createdBy: {inq: expFriendIds}},
{visibility: VisibilityType.FRIEND},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
// CurrentUser
Expand All @@ -1534,15 +1527,19 @@ export class FilterBuilderService {
{tags: {inq: allowedTags}} as Where,
{tags: {nin: prohibitedTags}} as Where,
{createdBy: currentUserId},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
{
and: [
{peopleId: {inq: peopleIds}},
{tags: {nin: prohibitedTags}} as Where,
{createdBy: currentUserId},
{[field]: {gte: selected?.addedAt ?? Date.now() + 60 * 60 * 1000}},
],
},
{
and: [
{tags: {nin: prohibitedTags}} as Where,
{createdBy: this.currentUser[securityId]},
],
},
{
Expand Down

0 comments on commit 7642891

Please sign in to comment.