Ver Fonte

add: use skip and limit in api call

Aryan Kothari há 9 meses atrás
pai
commit
d11961626c
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/lib/apis/chats/index.ts

+ 2 - 2
src/lib/apis/chats/index.ts

@@ -32,10 +32,10 @@ export const createNewChat = async (token: string, chat: object) => {
 	return res;
 };
 
-export const getChatList = async (token: string = '') => {
+export const getChatList = async (token: string = '', skip: number = 0, limit: number = -1) => {
 	let error = null;
 
-	const res = await fetch(`${WEBUI_API_BASE_URL}/chats/`, {
+	const res = await fetch(`${WEBUI_API_BASE_URL}/chats/?skip=${skip}&limit=${limit}`, {
 		method: 'GET',
 		headers: {
 			Accept: 'application/json',