diff --git a/ghost/core/core/server/services/mentions/BookshelfMentionRepository.js b/ghost/core/core/server/services/mentions/BookshelfMentionRepository.js index 5a9eac7a22..71b9bf6bf3 100644 --- a/ghost/core/core/server/services/mentions/BookshelfMentionRepository.js +++ b/ghost/core/core/server/services/mentions/BookshelfMentionRepository.js @@ -12,6 +12,7 @@ const logging = require('@tryghost/logging'); /** * @typedef {import('@tryghost/webmentions/lib/MentionsAPI').GetPageOptions} GetPageOptions + * @typedef {import('@tryghost/webmentions/lib/MentionsAPI').GetAllOptions} GetAllOptions */ /** @@ -84,6 +85,16 @@ module.exports = class BookshelfMentionRepository { }; } + /** + * @param {GetAllOptions} options + * @returns {Promise} + */ + async getAll(options) { + const models = await this.#MentionModel.findAll(options); + + return await Promise.all(models.map(model => this.#modelToMention(model))); + } + /** * @param {URL} source * @param {URL} target