IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

For some reason 200 seems to be a valid result for object creation as well as 202.

pull/1/head
parent
commit
d5e76ff524
2 changed files with 9 additions and 4 deletions
  1. +1
    -1
      frontend/src/js/dialog/wb-new-project-dialog.js
  2. +8
    -3
      frontend/src/js/misc/make-arvados-request.js

+ 1
- 1
frontend/src/js/dialog/wb-new-project-dialog.js View File

@@ -38,7 +38,7 @@ class WBNewProjectDialog extends Component {
makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/groups', { 'method': 'POST',
'data': JSON.stringify(group),
'expectedStatus': 202 }
'expectedStatus': [200, 202] }
).then(callback);
} }>
<div>


+ 8
- 3
frontend/src/js/misc/make-arvados-request.js View File

@@ -38,10 +38,15 @@ function makeArvadosRequest(arvHost, arvToken, endpoint, params={}) {
xhr.onreadystatechange = () => {
if (xhr.readyState !== 4)
return;
if (xhr.status !== expectedStatus)
reject(xhr);
else
if ((expectedStatus instanceof Array) &&
expectedStatus.indexOf(xhr.status) !== -1) {
accept(xhr);
} else if (expectedStatus === xhr.status) {
accept(xhr);
} else {
reject(xhr);
}
};
xhr.send(data);
});


Loading…
Cancel
Save