summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/http_status.js
blob: 5e5d10883a37ec6b23766b46f2cab15d5598196c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
 * exports HTTP status codes
 */

const httpStatusCodes = {
  ABORTED: 0,
  OK: 200,
  CREATED: 201,
  ACCEPTED: 202,
  NON_AUTHORITATIVE_INFORMATION: 203,
  NO_CONTENT: 204,
  RESET_CONTENT: 205,
  PARTIAL_CONTENT: 206,
  MULTI_STATUS: 207,
  ALREADY_REPORTED: 208,
  IM_USED: 226,
  MULTIPLE_CHOICES: 300,
  BAD_REQUEST: 400,
  UNAUTHORIZED: 401,
  FORBIDDEN: 403,
  NOT_FOUND: 404,
  GONE: 410,
  UNPROCESSABLE_ENTITY: 422,
};

export const successCodes = [
  httpStatusCodes.OK,
  httpStatusCodes.CREATED,
  httpStatusCodes.ACCEPTED,
  httpStatusCodes.NON_AUTHORITATIVE_INFORMATION,
  httpStatusCodes.NO_CONTENT,
  httpStatusCodes.RESET_CONTENT,
  httpStatusCodes.PARTIAL_CONTENT,
  httpStatusCodes.MULTI_STATUS,
  httpStatusCodes.ALREADY_REPORTED,
  httpStatusCodes.IM_USED,
];

export default httpStatusCodes;