Use named constant

This commit is contained in:
Cohee 2023-10-21 23:33:17 +03:00
parent 04a5d9694e
commit 18fa925855
1 changed files with 2 additions and 2 deletions

View File

@ -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');