Commit b1b725b0 authored by Matija Obreza's avatar Matija Obreza
Browse files

webapi JS bugfix

parent 8b1032c5
...@@ -17,15 +17,13 @@ var GenesysPGR = function(baseUrl, clientId) { ...@@ -17,15 +17,13 @@ var GenesysPGR = function(baseUrl, clientId) {
clientId: clientId, clientId: clientId,
baseUrl: baseUrl, baseUrl: baseUrl,
clientSecret: null, clientSecret: null,
defaultOptions: defaultOptions defaultOptions: defaultOptions,
};
};
GenesysPGR.prototype.getUrl = function(apiCall) { getUrl : function(apiCall) {
return this.baseUrl + '/webapi' + apiCall + '?client_id=' + this.clientId + (this.clientSecret!==null ? '&client_secret=' + this.clientSecret : ''); return this.baseUrl + '/webapi' + apiCall + '?client_id=' + this.clientId + (this.clientSecret!==null ? '&client_secret=' + this.clientSecret : '');
}; },
GenesysPGR.prototype.listAccessions = function (filter, opts) { listAccessions : function (filter, opts) {
var o = $.extend({}, GenesysPGR.defaultOptions, opts); var o = $.extend({}, GenesysPGR.defaultOptions, opts);
var json={filter: JSON.stringify(filter), startAt: Math.max(1, o.startAt), maxRecords: o.maxRecords }; var json={filter: JSON.stringify(filter), startAt: Math.max(1, o.startAt), maxRecords: o.maxRecords };
...@@ -43,9 +41,9 @@ GenesysPGR.prototype.listAccessions = function (filter, opts) { ...@@ -43,9 +41,9 @@ GenesysPGR.prototype.listAccessions = function (filter, opts) {
o.error(errorAsync); o.error(errorAsync);
} }
}); });
}; },
GenesysPGR.prototype.overview = function (filter, opts) { overview : function (filter, opts) {
var o = $.extend({}, GenesysPGR.defaultOptions, opts); var o = $.extend({}, GenesysPGR.defaultOptions, opts);
$.ajax(this.getUrl('/v0/acn/overview'), { $.ajax(this.getUrl('/v0/acn/overview'), {
...@@ -62,4 +60,7 @@ GenesysPGR.prototype.overview = function (filter, opts) { ...@@ -62,4 +60,7 @@ GenesysPGR.prototype.overview = function (filter, opts) {
o.error(errorAsync); o.error(errorAsync);
} }
}); });
}
};
}; };
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment