1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-12-26 14:47:51 +01:00

feat: add limit query for transaction search requests

This commit is contained in:
getlarge 2022-02-15 14:11:30 +01:00
parent 8c0c72622d
commit 46599f5446
No known key found for this signature in database
GPG Key ID: E4E13243600F9566
2 changed files with 8 additions and 6 deletions

View File

@ -178,10 +178,11 @@ export default class Connection {
/**
* @param search
*/
searchAssets(search) {
searchAssets(search, limit = 10) {
return this._req(Connection.getApiUrls('assets'), {
query: {
search
search,
limit
}
})
}
@ -189,10 +190,11 @@ export default class Connection {
/**
* @param search
*/
searchMetadata(search) {
searchMetadata(search, limit = 10) {
return this._req(Connection.getApiUrls('metadata'), {
query: {
search
search,
limit
}
})
}

View File

@ -225,7 +225,7 @@ test('Get asset for text', t => {
conn.searchAssets(search)
t.truthy(conn._req.calledWith(
expectedPath,
{ query: { search } }
{ query: { search, limit: 10 } }
))
})
@ -239,6 +239,6 @@ test('Get metadata for text', t => {
conn.searchMetadata(search)
t.truthy(conn._req.calledWith(
expectedPath,
{ query: { search } }
{ query: { search, limit: 10 } }
))
})