This commit is contained in:
Timothy Jaeryang Baek
2026-07-15 21:43:47 -04:00
parent 4d11553a6b
commit 423cafd4e7
21 changed files with 803 additions and 1158 deletions
+36
View File
@@ -218,6 +218,42 @@ export const getNoteById = async (token: string, id: string) => {
return res;
};
export const getNoteChatById = async (token: string, id: string) => {
let error = null;
const url = `${WEBUI_API_BASE_URL}/notes/${id}/chat`;
console.info('[note-chat] fetching linked chat', { noteId: id, url });
const res = await fetch(url, {
method: 'GET',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
}
})
.then(async (res) => {
console.info('[note-chat] linked chat response', {
noteId: id,
status: res.status,
ok: res.ok
});
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
error = err.detail;
console.error('[note-chat] linked chat request failed', { noteId: id, error: err });
return null;
});
if (error) {
throw error;
}
return res;
};
export const updateNoteById = async (token: string, id: string, note: NoteItem) => {
let error = null;