pass id instead of uuid for journalist_id #1147
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1148
When creating a Reply object, journalist_id needs to match the id of the authenticated user, not the uuid supplied in the token. There is ongoing work around how we manage authentication so this PR provides a minimal solution.
Test Plan
Check behavior is the same
Check db
main
and send a successful reply, a failed reply, and pending reply (you can apply these diffs to simulate failed and pending replies: https://gist.github.com/creviera/7f19a7d10334359f40dbdbb2354cd13a, https://gist.github.com/creviera/5ba70d50c12b6a6df6f98ed40ad09645)(Database migration for migrating replies.jouranlist_id wherever UUID was used instead of IDs will be needed for both the replies and draftreplies tables.)