diff options
Diffstat (limited to 'app/assets/javascripts/lib/utils/http_status.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/http_status.js | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/app/assets/javascripts/lib/utils/http_status.js b/app/assets/javascripts/lib/utils/http_status.js index ec0d8d433a5..678ebc35565 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; @@ -14,21 +15,15 @@ export const HTTP_STATUS_GONE = 410; export const HTTP_STATUS_PAYLOAD_TOO_LARGE = 413; export const HTTP_STATUS_UNPROCESSABLE_ENTITY = 422; export const HTTP_STATUS_TOO_MANY_REQUESTS = 429; - -// TODO move the rest of the status codes to primitive constants -// https://docs.gitlab.com/ee/development/fe_guide/style/javascript.html#export-constants-as-primitives -const httpStatusCodes = { - OK: 200, - BAD_REQUEST: 400, - UNAUTHORIZED: 401, - FORBIDDEN: 403, - NOT_FOUND: 404, - INTERNAL_SERVER_ERROR: 500, - SERVICE_UNAVAILABLE: 503, -}; +export const HTTP_STATUS_BAD_REQUEST = 400; +export const HTTP_STATUS_UNAUTHORIZED = 401; +export const HTTP_STATUS_FORBIDDEN = 403; +export const HTTP_STATUS_NOT_FOUND = 404; +export const HTTP_STATUS_INTERNAL_SERVER_ERROR = 500; +export const HTTP_STATUS_SERVICE_UNAVAILABLE = 503; export const successCodes = [ - httpStatusCodes.OK, + HTTP_STATUS_OK, HTTP_STATUS_CREATED, HTTP_STATUS_ACCEPTED, HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION, @@ -39,5 +34,3 @@ export const successCodes = [ HTTP_STATUS_ALREADY_REPORTED, HTTP_STATUS_IM_USED, ]; - -export default httpStatusCodes; |