Skip to content

Commit

Permalink
feat: add limit query for transaction search requests
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Feb 15, 2022
1 parent 8c0c726 commit 46599f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,23 @@ export default class Connection {
/**
* @param search
*/
searchAssets(search) {
searchAssets(search, limit = 10) {
return this._req(Connection.getApiUrls('assets'), {
query: {
search
search,
limit
}
})
}

/**
* @param search
*/
searchMetadata(search) {
searchMetadata(search, limit = 10) {
return this._req(Connection.getApiUrls('metadata'), {
query: {
search
search,
limit
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions test/connection/test_connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }
))
})

Expand All @@ -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 } }
))
})

0 comments on commit 46599f5

Please sign in to comment.