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:
parent
8c0c72622d
commit
46599f5446
@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -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 } }
|
||||
))
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user