fix: prompts delete

This commit is contained in:
Timothy Jaeryang Baek
2026-02-18 14:58:39 -06:00
parent 9b55343509
commit 094ed0b48c
4 changed files with 113 additions and 32 deletions
+28
View File
@@ -395,6 +395,34 @@ export const setProductionPromptVersion = async (
return res;
};
export const togglePromptById = async (token: string, promptId: string) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/prompts/id/${promptId}/toggle`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
error = err.detail;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const deletePromptById = async (token: string, promptId: string) => {
let error = null;