-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new endpoint for loading replies as Admin (#21676)
ref PLG-227 - Wired up a new endpoint that would be able to paginate replies as an admin user. - The difference compared to the members-api endpoint is that this includes hidden comments and includes the html string which is normally hidden from non-admin users
- Loading branch information
1 parent
f0dab9d
commit d800587
Showing
7 changed files
with
237 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// This is a new endpoint for the admin API to return replies to a comment with pagination | ||
|
||
const commentsService = require('../../services/comments'); | ||
|
||
/** @type {import('@tryghost/api-framework').Controller} */ | ||
const controller = { | ||
docName: 'comments', | ||
browse: { | ||
headers: { | ||
cacheInvalidate: false | ||
}, | ||
options: [ | ||
'include', | ||
'page', | ||
'limit', | ||
'fields', | ||
'filter', | ||
'order', | ||
'debug', | ||
'id' | ||
], | ||
validation: { | ||
options: { | ||
id: { | ||
required: true | ||
} | ||
} | ||
}, | ||
permissions: true, | ||
query(frame) { | ||
return commentsService.controller.adminReplies(frame); | ||
} | ||
} | ||
}; | ||
|
||
module.exports = controller; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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