mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Added getAll method to BookshelfMentionRepository
This is necessary to support the getMentionReport method in MentionsAPI
This commit is contained in:
parent
0262083bb0
commit
018e2654c5
@ -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<import('@tryghost/webmentions/lib/Mention')[]>}
|
||||
*/
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user