feat: dependency injection and comments threads - #418
Open
CodeVoyager wants to merge 6 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #418 +/- ##
==========================================
- Coverage 99.48% 99.33% -0.15%
==========================================
Files 42 42
Lines 1353 1357 +4
Branches 316 336 +20
==========================================
+ Hits 1346 1348 +2
- Misses 7 9 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
CommentRepositoryas an optional last argument on admin and common comment services (defaulting togetCommentRepository(strapi)), so callers can swap the repository without changing service internals.postCommentcreates a top-level admin comment (threadOf: null,relatedis the content relation), andpostCommentThreadreplies in an existing thread. The existing routePOST /moderate/thread/:id/postCommentnow callspostCommentThread, so the HTTP path for thread replies is unchanged.blockNestedThreadson the admin service as a wrapper aroundmodifiedNestedNestedComments.Test plan
POST /moderate/thread/:id/postCommentstill creates a child comment (threadOf= that id), not a top-level comment.postComment(service) creates a top-level admin comment on the related entity.blockNestedThreadsupdates descendantblockedThreadflags.admin.service,common.service,admin.controller.findAllInHierarchyresponse shape: the “pagination on comments tree” commit only changed tests to expect{ data, pagination }, but the service still returns an array. Either restore the old assertions or wrap the tree in{ data, pagination }before merge.