From f80e94c2449f37fb7bb833b7197b4073ce75de0b Mon Sep 17 00:00:00 2001 From: Rizwan Mustafa Date: Sat, 26 Feb 2022 07:00:08 +0500 Subject: [PATCH] Renamed themeId to themeID for consistency --- backend/api/controllers/user.js | 8 ++++---- backend/api/routes/users.ts | 8 ++++---- frontend/src/scripts/ape/endpoints/users.ts | 8 ++++---- frontend/src/scripts/ape/types/ape.d.ts | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/api/controllers/user.js b/backend/api/controllers/user.js index dbf196fc3..5ee56efc5 100644 --- a/backend/api/controllers/user.js +++ b/backend/api/controllers/user.js @@ -250,16 +250,16 @@ class UserController { static async removeCustomTheme(req, _res) { const { uid } = req.ctx.decodedToken; - const { themeID } = req.body; - await UsersDAO.removeTheme(uid, themeID); + const { themeId } = req.body; + await UsersDAO.removeTheme(uid, themeId); return new MonkeyResponse("Custom theme removed"); } static async editCustomTheme(req, _res) { const { uid } = req.ctx.decodedToken; - const { themeID, theme } = req.body; + const { themeId, theme } = req.body; - await UsersDAO.editTheme(uid, themeID, theme); + await UsersDAO.editTheme(uid, themeId, theme); return new MonkeyResponse("Custom theme updated"); } } diff --git a/backend/api/routes/users.ts b/backend/api/routes/users.ts index 33b253647..51f654a6d 100644 --- a/backend/api/routes/users.ts +++ b/backend/api/routes/users.ts @@ -52,8 +52,8 @@ const customThemeIdValidation = joi .regex(/^[0-9a-fA-F]+$/) .required() .messages({ - "string.length": "The themeID must be 24 characters long", - "string.pattern.base": "The themeID must be valid hexadecimal string", + "string.length": "The themeId must be 24 characters long", + "string.pattern.base": "The themeId must be valid hexadecimal string", }); router.get( @@ -227,7 +227,7 @@ router.delete( authenticateRequest(), validateRequest({ body: { - themeID: customThemeIdValidation, + themeId: customThemeIdValidation, }, }), asyncHandler(UserController.removeCustomTheme) @@ -239,7 +239,7 @@ router.put( authenticateRequest(), validateRequest({ body: { - themeID: customThemeIdValidation, + themeId: customThemeIdValidation, theme: { name: customThemeNameValidation, colors: customThemeColorsValidation, diff --git a/frontend/src/scripts/ape/endpoints/users.ts b/frontend/src/scripts/ape/endpoints/users.ts index 023714f92..8e0429202 100644 --- a/frontend/src/scripts/ape/endpoints/users.ts +++ b/frontend/src/scripts/ape/endpoints/users.ts @@ -95,11 +95,11 @@ export default function getUsersEndpoints( // } async function editCustomThemes( - themeID: string, + themeId: string, newTheme: Partial ): Ape.EndpointData { const payload = { - themeID: themeID, + themeId: themeId, theme: { name: newTheme.name, colors: newTheme.colors, @@ -108,9 +108,9 @@ export default function getUsersEndpoints( return await apeClient.put(`${BASE_PATH}/customThemes`, { payload }); } - async function deleteCustomThemes(themeID: string): Ape.EndpointData { + async function deleteCustomThemes(themeId: string): Ape.EndpointData { const payload = { - themeID: themeID, + themeId: themeId, }; return await apeClient.delete(`${BASE_PATH}/customThemes`, { payload }); } diff --git a/frontend/src/scripts/ape/types/ape.d.ts b/frontend/src/scripts/ape/types/ape.d.ts index 12a8d0e52..5ea515d41 100644 --- a/frontend/src/scripts/ape/types/ape.d.ts +++ b/frontend/src/scripts/ape/types/ape.d.ts @@ -115,10 +115,10 @@ declare namespace Ape { newTheme: Partial ) => EndpointData; editCustomThemes: ( - themeID: string, + themeId: string, newTheme: Partial ) => EndpointData; - deleteCustomThemes: (themeID: string) => EndpointData; + deleteCustomThemes: (themeId: string) => EndpointData; getTags: Endpoint; createTag: (tagName: string) => EndpointData; editTag: (tagId: string, newName: string) => EndpointData;