Skip to content

Commit

Permalink
3537/save search get opp (#3673)
Browse files Browse the repository at this point in the history
## Summary
Fixes #{3537}

### Time to review: __1 mins__

## Changes proposed
Fix factory field name 
Pass in searched_opportunity_ids to UserSavedSearch
  • Loading branch information
babebe authored Jan 28, 2025
1 parent 8ce19d2 commit 31eb2c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/src/services/users/create_saved_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

def create_saved_search(db_session: db.Session, user_id: UUID, json_data: dict) -> UserSavedSearch:
saved_search = UserSavedSearch(
user_id=user_id, name=json_data["name"], search_query=json_data["search_query"]
user_id=user_id,
name=json_data["name"],
search_query=json_data["search_query"],
searched_opportunity_ids=[],
)

db_session.add(saved_search)
Expand Down
2 changes: 1 addition & 1 deletion api/tests/src/db/models/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2050,4 +2050,4 @@ class Meta:

last_notified_at = factory.Faker("date_time_between", start_date="-5y", end_date="-3y")

search_opportunity_ids = factory.LazyAttribute(lambda _: random.sample(range(1, 1000), 5))
searched_opportunity_ids = factory.LazyAttribute(lambda _: random.sample(range(1, 1000), 5))

0 comments on commit 31eb2c0

Please sign in to comment.