diff options
Diffstat (limited to 'app/assets/javascripts/lib/utils')
-rw-r--r-- | app/assets/javascripts/lib/utils/http_status.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/poll_until_complete.js | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/lib/utils/http_status.js b/app/assets/javascripts/lib/utils/http_status.js index c3adb79bcbe..9ca4efe6dfe 100644 --- a/app/assets/javascripts/lib/utils/http_status.js +++ b/app/assets/javascripts/lib/utils/http_status.js @@ -1,4 +1,5 @@ export const HTTP_STATUS_ABORTED = 0; +export const HTTP_STATUS_OK = 200; export const HTTP_STATUS_CREATED = 201; export const HTTP_STATUS_ACCEPTED = 202; export const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203; @@ -28,7 +29,7 @@ const httpStatusCodes = { }; export const successCodes = [ - httpStatusCodes.OK, + HTTP_STATUS_OK, HTTP_STATUS_CREATED, HTTP_STATUS_ACCEPTED, HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION, diff --git a/app/assets/javascripts/lib/utils/poll_until_complete.js b/app/assets/javascripts/lib/utils/poll_until_complete.js index 3545db3a227..dbe54dceb52 100644 --- a/app/assets/javascripts/lib/utils/poll_until_complete.js +++ b/app/assets/javascripts/lib/utils/poll_until_complete.js @@ -1,5 +1,5 @@ import axios from '~/lib/utils/axios_utils'; -import httpStatusCodes from './http_status'; +import { HTTP_STATUS_OK } from './http_status'; import Poll from './poll'; /** @@ -30,7 +30,7 @@ export default (url, config = {}) => data: { url, config }, method: 'axiosGet', successCallback: (response) => { - if (response.status === httpStatusCodes.OK) { + if (response.status === HTTP_STATUS_OK) { resolve(response); eTagPoll.stop(); } |