|
@@ -76,7 +76,10 @@ export const getDocs = async (token: string = '') => {
|
|
export const getDocByName = async (token: string, name: string) => {
|
|
export const getDocByName = async (token: string, name: string) => {
|
|
let error = null;
|
|
let error = null;
|
|
|
|
|
|
- const res = await fetch(`${WEBUI_API_BASE_URL}/documents/name/${name}`, {
|
|
|
|
|
|
+ const searchParams = new URLSearchParams();
|
|
|
|
+ searchParams.append('name', name);
|
|
|
|
+
|
|
|
|
+ const res = await fetch(`${WEBUI_API_BASE_URL}/documents/docs?${searchParams.toString()}`, {
|
|
method: 'GET',
|
|
method: 'GET',
|
|
headers: {
|
|
headers: {
|
|
Accept: 'application/json',
|
|
Accept: 'application/json',
|
|
@@ -113,7 +116,10 @@ type DocUpdateForm = {
|
|
export const updateDocByName = async (token: string, name: string, form: DocUpdateForm) => {
|
|
export const updateDocByName = async (token: string, name: string, form: DocUpdateForm) => {
|
|
let error = null;
|
|
let error = null;
|
|
|
|
|
|
- const res = await fetch(`${WEBUI_API_BASE_URL}/documents/name/${name}/update`, {
|
|
|
|
|
|
+ const searchParams = new URLSearchParams();
|
|
|
|
+ searchParams.append('name', name);
|
|
|
|
+
|
|
|
|
+ const res = await fetch(`${WEBUI_API_BASE_URL}/documents/doc/update?${searchParams.toString()}`, {
|
|
method: 'POST',
|
|
method: 'POST',
|
|
headers: {
|
|
headers: {
|
|
Accept: 'application/json',
|
|
Accept: 'application/json',
|
|
@@ -154,7 +160,10 @@ type TagDocForm = {
|
|
export const tagDocByName = async (token: string, name: string, form: TagDocForm) => {
|
|
export const tagDocByName = async (token: string, name: string, form: TagDocForm) => {
|
|
let error = null;
|
|
let error = null;
|
|
|
|
|
|
- const res = await fetch(`${WEBUI_API_BASE_URL}/documents/name/${name}/tags`, {
|
|
|
|
|
|
+ const searchParams = new URLSearchParams();
|
|
|
|
+ searchParams.append('name', name);
|
|
|
|
+
|
|
|
|
+ const res = await fetch(`${WEBUI_API_BASE_URL}/documents/doc/tags?${searchParams.toString()}`, {
|
|
method: 'POST',
|
|
method: 'POST',
|
|
headers: {
|
|
headers: {
|
|
Accept: 'application/json',
|
|
Accept: 'application/json',
|
|
@@ -190,7 +199,10 @@ export const tagDocByName = async (token: string, name: string, form: TagDocForm
|
|
export const deleteDocByName = async (token: string, name: string) => {
|
|
export const deleteDocByName = async (token: string, name: string) => {
|
|
let error = null;
|
|
let error = null;
|
|
|
|
|
|
- const res = await fetch(`${WEBUI_API_BASE_URL}/documents/name/${name}/delete`, {
|
|
|
|
|
|
+ const searchParams = new URLSearchParams();
|
|
|
|
+ searchParams.append('name', name);
|
|
|
|
+
|
|
|
|
+ const res = await fetch(`${WEBUI_API_BASE_URL}/documents/doc/delete?${searchParams.toString()}`, {
|
|
method: 'DELETE',
|
|
method: 'DELETE',
|
|
headers: {
|
|
headers: {
|
|
Accept: 'application/json',
|
|
Accept: 'application/json',
|