refac
This commit is contained in:
1 parent
805bfca5af
commit
954613944b
5 files changed
+349
-205
No files matched your search
@@ -31,10 +31,13 @@ export const createNewSkill = async (token: string, skill: object) => {
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getSkills = async (token: string = '') => {
|
||||
export const getSkills = async (token: string = '', query: string | null = null) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/skills/`, {
|
||||
const searchParams = new URLSearchParams();
|
||||
if (query) searchParams.append('query', query);
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/skills/?${searchParams.toString()}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
|
||||
@@ -65,10 +65,13 @@ export const loadToolByUrl = async (token: string = '', url: string) => {
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getTools = async (token: string = '') => {
|
||||
export const getTools = async (token: string = '', query: string | null = null) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/tools/`, {
|
||||
const searchParams = new URLSearchParams();
|
||||
if (query) searchParams.append('query', query);
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/tools/?${searchParams.toString()}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
|
||||
Reference in new issue
Block a user