mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Fix OpenAI presets extension
This commit is contained in:
parent
64496425cc
commit
d0a35deeec
@ -103,7 +103,7 @@ router.post('/save-openai', jsonParser, function (request, response) {
|
||||
const name = sanitize(request.query.name);
|
||||
if (!name) return response.sendStatus(400);
|
||||
|
||||
const filename = `${name}.settings`;
|
||||
const filename = `${name}.json`;
|
||||
const fullpath = path.join(DIRECTORIES.openAI_Settings, filename);
|
||||
writeFileAtomicSync(fullpath, JSON.stringify(request.body, null, 4), 'utf-8');
|
||||
return response.send({ name });
|
||||
@ -116,7 +116,7 @@ router.post('/delete-openai', jsonParser, function (request, response) {
|
||||
}
|
||||
|
||||
const name = request.body.name;
|
||||
const pathToFile = path.join(DIRECTORIES.openAI_Settings, `${name}.settings`);
|
||||
const pathToFile = path.join(DIRECTORIES.openAI_Settings, `${name}.json`);
|
||||
|
||||
if (fs.existsSync(pathToFile)) {
|
||||
fs.rmSync(pathToFile);
|
||||
|
Loading…
Reference in New Issue
Block a user