mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Removed unused collections repositories
no issue - These repositories were leftover from first phases of collections development. Not needed any longer as we have more specialized bookshelf repositories in the core code
This commit is contained in:
parent
25fb1c43c2
commit
382d7fa25f
2 changed files with 0 additions and 46 deletions
|
@ -1,23 +0,0 @@
|
||||||
class PostsDataRepositoryBookshelf {
|
|
||||||
Post;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Object} deps
|
|
||||||
* @param {import('../../models/post')} deps.Post
|
|
||||||
*/
|
|
||||||
constructor(deps) {
|
|
||||||
this.Post = deps.Post;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string[]} ids
|
|
||||||
* @returns {Promise<import('../../models/post')>}
|
|
||||||
**/
|
|
||||||
async getBulk(ids) {
|
|
||||||
return await this.Post.fetchAll({
|
|
||||||
filter: `id:[${ids.join(',')}]`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = PostsDataRepositoryBookshelf;
|
|
|
@ -1,23 +0,0 @@
|
||||||
const sinon = require('sinon');
|
|
||||||
const assert = require('assert/strict');
|
|
||||||
const {PostsDataRepositoryBookshelf} = require('../../../../../core/server/services/collections/PostsDataRepositoryBookshelf');
|
|
||||||
|
|
||||||
describe('PostsDataRepositoryBookshelf', function () {
|
|
||||||
let Post;
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
|
||||||
Post = {
|
|
||||||
fetchAll: sinon.stub().resolves([])
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Can fetch posts by ids', async function () {
|
|
||||||
const repository = new PostsDataRepositoryBookshelf({
|
|
||||||
Post: Post
|
|
||||||
});
|
|
||||||
|
|
||||||
await repository.getBulk(['1', '2']);
|
|
||||||
|
|
||||||
assert.ok(Post.fetchAll.calledOnce);
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Add table
Reference in a new issue