From 85424fe2196504b101a879cbc6d49a1a304ade41 Mon Sep 17 00:00:00 2001 From: galta <48960890+galta95@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:05:24 +0200 Subject: [PATCH] style(constants): rename constants --- package-lock.json | 3 ++- src/api/v6/index.ts | 4 ++-- src/lib/constants.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a87b4f4..ecd50b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2931,7 +2931,8 @@ "prettier": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==" + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "dev": true }, "process-nextick-args": { "version": "2.0.1", diff --git a/src/api/v6/index.ts b/src/api/v6/index.ts index e6b2ca4..6ff3962 100644 --- a/src/api/v6/index.ts +++ b/src/api/v6/index.ts @@ -9,7 +9,7 @@ import { NotAllowedError, ChangesetAlreadyClosedError, } from '../../lib/errors'; -import { ownerMismatch } from '../../lib/constants'; +import { OWNER_MISMATCH } from '../../lib/constants'; class Apiv6 { private readonly httpClient: AxiosInstance; @@ -52,7 +52,7 @@ class Apiv6 { } else if (axiosError.response?.status === StatusCodes.NOT_FOUND) { throw new ChangesetNotFoundError(axiosError); } else if (axiosError.response?.status === StatusCodes.CONFLICT) { - if (axiosError.response.data === ownerMismatch) { + if (axiosError.response.data === OWNER_MISMATCH) { throw new OwnerMismatchError(axiosError); } throw new ChangesetAlreadyClosedError(axiosError); diff --git a/src/lib/constants.ts b/src/lib/constants.ts index af0ca41..f1ee6c0 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1 +1 @@ -export const ownerMismatch = "The user doesn't own that changeset"; +export const OWNER_MISMATCH = "The user doesn't own that changeset";