This commit is contained in:
Timothy Jaeryang Baek
2026-02-10 15:57:08 -06:00
parent 4aedfdc547
commit 30f72672fa
3 changed files with 115 additions and 25 deletions
+33
View File
@@ -253,6 +253,39 @@ export const updateNoteById = async (token: string, id: string, note: NoteItem)
return res;
};
export const updateNoteAccessGrants = async (
token: string,
id: string,
accessGrants: any[]
) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/notes/${id}/access/update`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
},
body: JSON.stringify({ access_grants: accessGrants })
})
.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 deleteNoteById = async (token: string, id: string) => {
let error = null;