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!
소스 검색

Configurable expected status in makeArvadosRequest()

master
부모
커밋
d37252dded
3개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. +2
    -2
      frontend/src/js/dialog/wb-new-project-dialog.js
  2. +5
    -3
      frontend/src/js/misc/make-arvados-request.js
  3. +1
    -1
      frontend/src/js/misc/wb-delete-object.js

+ 2
- 2
frontend/src/js/dialog/wb-new-project-dialog.js 파일 보기

@@ -36,9 +36,9 @@ class WBNewProjectDialog extends Component {
'owner_uuid': ownerUuid
};
makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/groups', { 'method': 'POST',
'/arvados/v1/groups?async=true', { 'method': 'POST',
'data': JSON.stringify(group),
'promiseOrdering': false }
'expectedStatus': 202 }
).then(callback);
} }>
<div>


+ 5
- 3
frontend/src/js/misc/make-arvados-request.js 파일 보기

@@ -11,13 +11,15 @@ function makeArvadosRequest(arvHost, arvToken, endpoint, params={}) {
'useSsl': true,
'requireToken': true,
'onProgress': () => {},
'promiseOrdering': true
'promiseOrdering': true,
'expectedStatus': 200
};
Object.keys(defaultParams).map(k => (params[k] =
(k in params ? params[k] : defaultParams[k])));
let { method, data, contentType, responseType,
useSsl, requireToken, onProgress, promiseOrdering } = params;
useSsl, requireToken, onProgress, promiseOrdering,
expectedStatus } = params;
if (!(arvHost && (arvToken || !requireToken)))
return new Promise((accept, reject) => reject());
@@ -36,7 +38,7 @@ function makeArvadosRequest(arvHost, arvToken, endpoint, params={}) {
xhr.onreadystatechange = () => {
if (xhr.readyState !== 4)
return;
if (xhr.status !== 200)
if (xhr.status !== expectedStatus)
reject(xhr);
else
accept(xhr);


+ 1
- 1
frontend/src/js/misc/wb-delete-object.js 파일 보기

@@ -5,7 +5,7 @@ function wbDeleteObject(arvHost, arvToken, uuid) {
const typeName = arvadosTypeName(uuid);
return makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/' + typeName + 's/' +
uuid, { 'method': 'DELETE', 'promiseOrdering': false });
uuid, { 'method': 'DELETE' });
}
export default wbDeleteObject;

불러오는 중...
취소
저장