Move missed endpoints

This commit is contained in:
Cohee
2023-09-16 18:03:31 +03:00
parent 61995bb33f
commit ab9aa28fe4
5 changed files with 82 additions and 77 deletions

View File

@ -2425,14 +2425,16 @@ async function onDeletePresetClick() {
$('#settings_perset_openai').trigger('change');
}
const response = await fetch('/deletepreset_openai', {
const response = await fetch('/api/presets/delete-openai', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ name: nameToDelete }),
});
if (!response.ok) {
console.warn('Preset was not deleted from server');
toastr.warning('Preset was not deleted from server');
} else {
toastr.success('Preset deleted');
}
saveSettingsDebounced();