|
@@ -92,7 +92,12 @@ export const getFolderById = async (token: string, id: string) => {
|
|
return res;
|
|
return res;
|
|
};
|
|
};
|
|
|
|
|
|
-export const updateFolderNameById = async (token: string, id: string, name: string) => {
|
|
|
|
|
|
+type FolderForm = {
|
|
|
|
+ name: string;
|
|
|
|
+ data?: Record<string, any>;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+export const updateFolderById = async (token: string, id: string, folderForm: FolderForm) => {
|
|
let error = null;
|
|
let error = null;
|
|
|
|
|
|
const res = await fetch(`${WEBUI_API_BASE_URL}/folders/${id}/update`, {
|
|
const res = await fetch(`${WEBUI_API_BASE_URL}/folders/${id}/update`, {
|
|
@@ -102,9 +107,7 @@ export const updateFolderNameById = async (token: string, id: string, name: stri
|
|
'Content-Type': 'application/json',
|
|
'Content-Type': 'application/json',
|
|
authorization: `Bearer ${token}`
|
|
authorization: `Bearer ${token}`
|
|
},
|
|
},
|
|
- body: JSON.stringify({
|
|
|
|
- name: name
|
|
|
|
- })
|
|
|
|
|
|
+ body: JSON.stringify(folderForm)
|
|
})
|
|
})
|
|
.then(async (res) => {
|
|
.then(async (res) => {
|
|
if (!res.ok) throw await res.json();
|
|
if (!res.ok) throw await res.json();
|