refac: chat tags

This commit is contained in:
Timothy J. Baek
2024-05-03 15:25:41 -07:00
parent e8085f80a7
commit facb6edfdc
2 changed files with 19 additions and 7 deletions

View File

@@ -220,13 +220,16 @@ export const getAllChatTags = async (token: string) => {
export const getChatListByTagName = async (token: string = '', tagName: string) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/tags/tag/${tagName}`, {
method: 'GET',
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/tags`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...(token && { authorization: `Bearer ${token}` })
}
},
body: JSON.stringify({
name: tagName
})
})
.then(async (res) => {
if (!res.ok) throw await res.json();