feat/enh: group channel

This commit is contained in:
Timothy Jaeryang Baek
2025-11-30 08:24:27 -05:00
parent 696f356881
commit f589b7c189
17 changed files with 830 additions and 369 deletions
+1
View File
@@ -3,6 +3,7 @@ import { WEBUI_API_BASE_URL } from '$lib/constants';
type ChannelForm = {
type?: string;
name: string;
is_private?: boolean;
data?: object;
meta?: object;
access_control?: object;
+26 -4
View File
@@ -166,11 +166,33 @@ export const getUsers = async (
return res;
};
export const getAllUsers = async (token: string) => {
export const searchUsers = async (
token: string,
query?: string,
orderBy?: string,
direction?: string,
page = 1
) => {
let error = null;
let res = null;
res = await fetch(`${WEBUI_API_BASE_URL}/users/all`, {
const searchParams = new URLSearchParams();
searchParams.set('page', `${page}`);
if (query) {
searchParams.set('query', query);
}
if (orderBy) {
searchParams.set('order_by', orderBy);
}
if (direction) {
searchParams.set('direction', direction);
}
res = await fetch(`${WEBUI_API_BASE_URL}/users/search?${searchParams.toString()}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@@ -194,11 +216,11 @@ export const getAllUsers = async (token: string) => {
return res;
};
export const searchUsers = async (token: string, query: string) => {
export const getAllUsers = async (token: string) => {
let error = null;
let res = null;
res = await fetch(`${WEBUI_API_BASE_URL}/users/search?query=${encodeURIComponent(query)}`, {
res = await fetch(`${WEBUI_API_BASE_URL}/users/all`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',