diff --git a/ghost/collections/src/CollectionsService.ts b/ghost/collections/src/CollectionsService.ts index 47ab519aaf..ffcd35377b 100644 --- a/ghost/collections/src/CollectionsService.ts +++ b/ghost/collections/src/CollectionsService.ts @@ -21,8 +21,22 @@ export class CollectionsService { return await this.repository.getById(id); } - async getAll(): Promise { - return await this.repository.getAll(); + async getAll(options?: any): Promise<{data: Collection[], meta: any}> { + const collections = await this.repository.getAll(options); + + return { + data: collections, + meta: { + pagination: { + page: 1, + pages: 1, + limit: collections.length, + total: collections.length, + prev: null, + next: null + } + } + }; } async destroy(id: string): Promise { diff --git a/ghost/collections/test/collections.test.ts b/ghost/collections/test/collections.test.ts index 7a1e5511a4..4285c9692e 100644 --- a/ghost/collections/test/collections.test.ts +++ b/ghost/collections/test/collections.test.ts @@ -30,7 +30,7 @@ describe('collections', function () { assert.equal(createdCollection.title, 'testing collections', 'Collection title should match'); const allCollections = await collectionsService.getAll(); - assert.equal(allCollections.length, 1, 'There should be one collection'); + assert.equal(allCollections.data.length, 1, 'There should be one collection'); await collectionsService.destroy(savedCollection.id); const deletedCollection = await collectionsService.getById(savedCollection.id);