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

[Issue #3293] Create POST /users/:userId/saved-opportunities API schema and stub endpoint #3330

Merged
merged 20 commits into from
Dec 20, 2024

Conversation

mikehgrantsgov
Copy link
Collaborator

Summary

Fixes #3293

Time to review: 20 mins

Changes proposed

Create an API for users to save opportunities.
Make sure this API is scoped to the currently logged in user
Response body a basic success message

Additional information

See attached unit tests

@mikehgrantsgov mikehgrantsgov changed the base branch from main to mikehgrantsgov/3291-create-saved-opportunities-model December 20, 2024 15:40
api/src/api/users/user_routes.py Show resolved Hide resolved
Comment on lines 10 to 12
user = UserFactory.create()
token, _ = create_jwt_for_user(user, db_session)
db_session.commit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could use a test utility that is like "get_test_user" that we'll eventually be able to pass things like roles into for a given unit test. Might be worth looking into setting that up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did abstract this slightly to remove duplication. I suppose the fixture I added could be added to conftest?

api/tests/src/api/users/test_user_save_opportunity_post.py Outdated Show resolved Hide resolved
Base automatically changed from mikehgrantsgov/3291-create-saved-opportunities-model to main December 20, 2024 19:48
@mikehgrantsgov mikehgrantsgov marked this pull request as ready for review December 20, 2024 19:52
Copy link
Collaborator

@chouinar chouinar left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikehgrantsgov mikehgrantsgov merged commit 9f9d41f into main Dec 20, 2024
2 checks passed
@mikehgrantsgov mikehgrantsgov deleted the mikehgrantsgov/3293-create-save-opp-api branch December 20, 2024 20:27
doug-s-nava pushed a commit that referenced this pull request Dec 30, 2024
…ma and stub endpoint (#3330)

## Summary
Fixes #3293 

### Time to review: 20 mins

## Changes proposed
Create an API for users to save opportunities.
Make sure this API is scoped to the currently logged in user
Response body a basic success message

## Additional information
See attached unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create POST /users/:userId/saved-opportunities API schema and stub endpoint
3 participants