Skip to content

Commit

Permalink
Merge pull request #22 from antolinos/master
Browse files Browse the repository at this point in the history
Version has been updated
  • Loading branch information
antolinos authored Feb 28, 2018
2 parents cf66b49 + 65e9e9e commit e14ee17
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ispyb-js-api",
"version": "5.4.0",
"version": "5.4.5",
"homepage": "https://github.com/ispyb/ispyb-js-api",
"description": "ISPyB javascript API",
"main": "index.html",
Expand Down
25 changes: 4 additions & 21 deletions js/dataadapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,8 @@ DataAdapter.prototype.get = function(url){
url: this.getUrl( url),
type: 'get',
async : this.async,
statusCode: {

401 : function(){
_this.onError.notify('401 Unauthorized');
},
404 : function(){

_this.onError.notify('404 : not found');
},
415 : function(){

_this.onError.notify('415 : type not allowed');
},
500 : function(){
_this.onError.notify('500 : internal server error');
}
},
success: function(data){


success: function(data){
_this.onSuccess.notify(data);
},
error: function(error, message){
Expand All @@ -138,7 +121,7 @@ DataAdapter.prototype.post = function(url, data){
$.ajax({
type: "POST",
async : this.async,
statusCode: {
/* statusCode: {
401 : function(){
_this.onError.notify('401 Unauthorized');
Expand All @@ -155,7 +138,7 @@ DataAdapter.prototype.post = function(url, data){
_this.onError.notify('500 : internal server error');
}
},
},*/
url: url,
data: data,
success: function(data){
Expand Down
7 changes: 7 additions & 0 deletions js/proposal/shippingdataadapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,11 @@ ShippingDataAdapter.prototype.getDewarLabelURL = function(shippingId, dewarId){
*/
ShippingDataAdapter.prototype.getDewarTrackingHistory = function(shippingId){
this.get('/{token}/proposal/{proposal}/shipping/{0}/history'.format([shippingId]));
};

ShippingDataAdapter.prototype.addDewarsToShipment = function(shippingId, dewars){
var url = ('/{token}/proposal/{proposal}/shipping/{0}/dewars/add'.format([shippingId]));
this.post(url, {
dewars : JSON.stringify(dewars)
});
};

0 comments on commit e14ee17

Please sign in to comment.