Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wderocco8
Copy link
Member

What does this PR do?

Added necessary backend changes to support frontend PR. This involved:

  • creating an update_many_documents function inside of MongoModule
  • added modify_rush_settings called by /events/rush/settings/{default_rush_category_id} API endpoint

Type of change

  • Fix: Bug fix (non-breaking change which fixes an issue)
  • Refactor: Any code refactoring
  • Chore: technical debt, workflow improvements
  • Feature: New feature (non-breaking change which adds functionality)
  • Documentation: This change requires a documentation update
  • Merge: Pushing features to an upper envrironment

Tests Performed

Screenshots

Additional Comments

@wderocco8 wderocco8 requested a review from jinyoungbang July 7, 2024 20:25
@github-actions
Copy link

github-actions bot commented Jul 7, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1769 1302 74% 70% 🟢

New Files

File Coverage Status
tests/api/test_events.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
chalicelib/api/events.py 98% 🟢
chalicelib/modules/mongo.py 25% 🟢
chalicelib/services/EventService.py 19% 🟢
tests/api/test_applicants.py 100% 🟢
tests/api/test_insights.py 100% 🟢
tests/api/test_listings.py 100% 🟢
TOTAL 74% 🟢

updated for commit: af0ceb5 by action🐍

Copy link
Contributor

@jinyoungbang jinyoungbang left a comment

Choose a reason for hiding this comment

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

See the comments and would love to see the reasoning behind the string null – apart from that, LGTM! Let's merge after I understand the design choice behind it.

@events_api.route("/events/rush/settings/{default_rush_category_id}", methods=["PATCH"], cors=True)
@auth(events_api, roles=["admin"])
def modify_rush_settings(default_rush_category_id):
if default_rush_category_id == "null":
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the string null ever popup?

return False

@add_env_suffix
def update_many_documents(self, collection: str, filter_query: dict, update_query: dict, array_filters=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

def update_many_documents(self, collection: str, filter_query: dict, update_query: dict, array_filters=None): -> dict

You could also potentially typecast the return value too

@wderocco8
Copy link
Member Author

See the comments and would love to see the reasoning behind the string null – apart from that, LGTM! Let's merge after I understand the design choice behind it.

Lowkey I agree. I initially passed null from the frontend to avoid confusing it with a defaultRushCategoryId that is empty string "" (but this isn't possible anyways, so I think it makes more sense to just see ""). Going to fix now!

@wderocco8 wderocco8 changed the title added boilerplate for update_many_documents + modify_rush_settings added boilerplate for update_many_documents + modify_rush_settings (and added some API unittests for events) Jul 13, 2024
@wderocco8 wderocco8 merged commit a98f2f2 into dev/v1.0 Jul 13, 2024
@wderocco8 wderocco8 deleted the fix/add-date-and-location-fields-ZAP branch July 13, 2024 02:13
@wderocco8 wderocco8 added the improvement Enhancements label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants