fix: issues in comment_count & subscriptions api#64
Merged
Faraz32123 merged 1 commit intomasterfrom Aug 26, 2024
Merged
Conversation
- `comment_count` is calculated on run time during API call in a
`ThreadSerializer` and returned in a response. As a result,
it does not sync with mongodb data. So it should be updated
through a signal or in current implementation of mongo models,
`comment_count` should be adjusted when there's any comment
created/deleted. This commit will fix this issue and will update
comment_count when comment is created/deleted.
- fix an issue in user subscriptions get request params validation.
- fix an issue in field name comment_count in the `ThreadSerializer`.
- code refactoring
- exclude endorsement field in case of get comment data
and only save parent_id for child comment.
This will keep the responses same for v1 and v2.
c664f08 to
d8be6a9
Compare
taimoor-ahmed-1
approved these changes
Aug 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
comment_countis calculated on run time during API call in aThreadSerializerand returned in a response. As a result, it does not sync with mongodb data. So it should be updated through a signal or in current implementation of mongo models,comment_countshould be adjusted when there's any comment created/deleted. This commit will fix this issue and will update comment_count when comment is created/deleted.ThreadSerializer.