mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Use named constant
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user