From 18fa925855086374c3e61a72f82478255b6174be Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 21 Oct 2023 23:33:17 +0300 Subject: [PATCH] Use named constant --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index d1bf1a6ea..bd1fb1fd5 100644 --- a/server.js +++ b/server.js @@ -1535,8 +1535,8 @@ app.post("/delchat", jsonParser, function (request, response) { app.post('/renamebackground', jsonParser, function (request, response) { if (!request.body) return response.sendStatus(400); - const oldFileName = path.join('public/backgrounds/', sanitize(request.body.old_bg)); - const newFileName = path.join('public/backgrounds/', sanitize(request.body.new_bg)); + const oldFileName = path.join(DIRECTORIES.backgrounds, sanitize(request.body.old_bg)); + const newFileName = path.join(DIRECTORIES.backgrounds, sanitize(request.body.new_bg)); if (!fs.existsSync(oldFileName)) { console.log('BG file not found');