Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsc-events-nestjs-10-136-getAllActivities-implement-filtering-by-tags #137

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

cshimm
Copy link
Contributor

@cshimm cshimm commented Jul 20, 2024

resolves #136

This PR updates the existing filtering by tag logic in the getAllActivities service method to support an array of tags, rather than just one tag. The filter logic uses $and which will return only events with all tags in the provided tags query. If no tags are provided, the tags filter is not applied.

Applying the filtering in the back-end will allow for more control over events and pagination. Doing it this way means the user can apply a tags filter and use the "Load more events" button to load more events with the tags filter applied.

2024-07-20.11-47-50.mp4

This video demonstrates

  • All events returned with no tags query
  • Querying events with "Professional Development" tag
  • Querying events with "Social" tag
  • Querying events with "Social" and "Tech" tag
  • No events returned when "Social", "Tech" and "Pizza" tags were queried since I have no events in my local db that have all 3 of those tags.

I will open a PR in the front-end project to implement the UI for tags filtering once this PR is approved and merged.

@cshimm cshimm self-assigned this Jul 20, 2024
@cshimm cshimm linked an issue Jul 20, 2024 that may be closed by this pull request
@cshimm cshimm added the enhancement New feature or request label Jul 20, 2024
@cshimm cshimm marked this pull request as ready for review July 20, 2024 18:53
@cshimm cshimm requested review from Ali-7s, a team, bcko, IsaacJrTypes, keiffer213, heosman, brinkbrink, taylorpapke and intisarosman1 and removed request for a team July 20, 2024 18:54
Copy link
Contributor

@heosman heosman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this PR with Postman and it looks like it's working good with single tag and multiple tag filtering.

image

Copy link
Contributor

@Ali-7s Ali-7s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
PR works with one and multiple tags filtering
image

@heosman heosman merged commit 696ea80 into main Jul 22, 2024
3 checks passed
@heosman heosman deleted the feature-136-getAllActivities-implement-tags-filter branch July 22, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Sprint 10
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Modify getAllActivities service method to support querying by tags
3 participants