Skip to content

Commit 5802afa

Browse files
authored
Merge pull request #19 from IntegratedBreedingPlatform/fix-v2-searchResultsDbId
Fix v2 searchResultDbId > searchResultsDbId
2 parents 5ab54d3 + 4a4acf4 commit 5802afa

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ This method registers a callback function which is called once a node has loaded
313313
| _node_.search_calls(_params_,...)||`/search/calls` | `POST-->GET` |
314314
| _node_.search_callsets(_params_,...)||`/search/callsets` | `POST-->GET` |
315315
| _node_.search_germplasm(_params_,...) | `/germplasm-search` | `/search/germplasm` | `POST-->GET` |
316-
| _node_.search_GET(_entity_, _params_,...)| `/search/{entity}/{searchResultDbId}` | | `GET` |
316+
| _node_.search_GET(_entity_, _params_,...)| `/search/{entity}/{searchResultDbId}` | `/search/{entity}/{searchResultsDbId}` | `GET` |
317317
| _node_.search_images(_params_,...) | `/search/images` | `/search/images` | `POST-->GET` |
318318
| _node_.search_lists(_params_,...)||`/search/lists` | `POST-->GET` |
319319
| _node_.search_locations(_params_,...)||`/search/locations` | `POST-->GET` |
@@ -332,7 +332,7 @@ This method registers a callback function which is called once a node has loaded
332332
| _node_.search_trials(_params_,...)||`/search/trials` | `POST-->GET` |
333333
| _node_.search_variants(_params_,...)||`/search/variants` | `POST-->GET` |
334334
| _node_.search_variantsets(_params_,...)||`/search/variantsets` | `POST-->GET` |
335-
| _node_.search(_entity_, _params_,...) | `/search/{entity-->search/{entity}/{searchResultDbId}` | | `POST-->GET` |
335+
| _node_.search(_entity_, _params_,...) | `/search/{entity-->search/{entity}/{searchResultDbId}` | `/search/{entity-->search/{entity}/{searchResultsDbId}` | `POST-->GET` |
336336
| _node_.seasons_detail(_params_,...)||`/seasons/{seasonDbId}` | `GET` |
337337
| _node_.seasons_modify(_params_,...)||`/seasons/{seasonDbId}` | `PUT` |
338338
| _node_.seasons_store(_params_,...)||`/seasons` | `POST` |
@@ -388,4 +388,4 @@ This method registers a callback function which is called once a node has loaded
388388
| _node_.vendor_plates_detail(_params_,...) | `/vendor/plates/{submissionId}` | `/vendor/plates/{submissionId}` | `GET` |
389389
| _node_.vendor_plates_search(_params_,...) | `/vendor/plates-search`(>=v1.2) or `/vendor/plate-search`(<v1.2) || `POST` |
390390
| _node_.vendor_plates(_params_,...) | `/vendor/plates` | `/vendor/plates` | `POST` |
391-
| _node_.vendor_specifications(_params_,...) | `/vendor/specifications` | `/vendor/specifications` | `GET` |
391+
| _node_.vendor_specifications(_params_,...) | `/vendor/specifications` | `/vendor/specifications` | `GET` |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solgenomics/brapijs",
3-
"version": "1.0.2",
3+
"version": "2.0.1",
44
"description": "BrAPI.js is a JavaScript client library for [BrAPI](https://brapi.org). It can be used either in the browser or within Node.js. It uses the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) (or [node-fetch]() in Node.js) for AJAX calls. BrAPI.js also uses ES6 classes.",
55
"bugs": {
66
"url": "https://github.com/solgenomics/BrAPI.js/issues"

src/brapi_methods/search.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** `POST /search/{entity} then GET /search/{entity}/{searchResultDbId}`
1+
/** `POST /search/{entity} then GET /search/{entity}/{searchResultsDbId}`
22
* @alias BrAPINode.prototype.search
33
* @param {String} entity Entity type to search over
44
* @param {Object} params Parameters to provide to the call
@@ -18,7 +18,8 @@ export function search(entity,params,behavior){
1818
});
1919
return param_map.join(search_ids).search_GET(entity,function(joined){
2020
var get_params = {};
21-
get_params.searchResultDbId = joined[1].searchResultDbId;
21+
// searchResultDbId for v1 compatibility
22+
get_params.searchResultsDbId = joined[1].searchResultsDbId || joined[1].searchResultDbId;
2223
if(joined[0].page!=undefined) get_params.page = joined[0].page;
2324
if(joined[0].pageRange!=undefined) get_params.pageRange = joined[0].pageRange;
2425
if(joined[0].pageSize!=undefined) get_params.pageSize = joined[0].pageSize;
@@ -41,7 +42,7 @@ export function search_POST(entity,params){
4142
}
4243
return this.simple_brapi_call(call);
4344
};
44-
/** `GET /search/{entity}/{searchResultDbId}`
45+
/** `GET /search/{entity}/{searchResultsDbId}`
4546
* @alias BrAPINode.prototype.search_GET
4647
* @param {String} entity Entity type to search over
4748
* @param {Object} params Parameters to provide to the call
@@ -51,7 +52,7 @@ export function search_POST(entity,params){
5152
export function search_GET(entity,params,behavior){
5253
var call = {
5354
'defaultMethod': 'get',
54-
'urlTemplate': '/search/'+entity+'/{searchResultDbId}',
55+
'urlTemplate': '/search/'+entity+'/{searchResultsDbId}',
5556
'params': params,
5657
'behaviorOptions': ['fork','map'],
5758
'behavior': behavior,

0 commit comments

Comments
 (0)