feat(GET /pins/:page): Adding pagenation to endpoint

This commit is contained in:
Chris Troutner
2025-04-16 07:29:27 -07:00
parent 22e32a6fc1
commit 89a03e561a
5 changed files with 14 additions and 7 deletions
@@ -400,12 +400,14 @@ describe('#IPFS REST API', () => {
assert.isTrue(ctx.body.success)
})
})
describe('#getPins', () => {
it('should return 422 status on biz logic error', async () => {
try {
sandbox.stub(uut.adapters.ipfsFiles, 'getPins').throws(new Error('test error'))
ctx.request.body = {}
ctx.params = { page: 1}
await uut.getPins(ctx)
@@ -421,12 +423,14 @@ describe('#IPFS REST API', () => {
sandbox.stub(uut.adapters.ipfsFiles, 'getPins').resolves({ success: true })
ctx.request.body = {}
ctx.params = { page: 1}
await uut.getPins(ctx)
assert.isTrue(ctx.body.success)
})
})
describe('#cid2json', () => {
it('should return 422 status on biz logic error', async () => {
try {