mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
🔄 refactor: Principal Type Handling in Search Principals to use Array
This commit is contained in:
parent
dcd96c29c5
commit
803ade8601
9 changed files with 68 additions and 151 deletions
|
|
@ -315,15 +315,15 @@ export const memory = (key: string) => `${memories()}/${encodeURIComponent(key)}
|
|||
export const memoryPreferences = () => `${memories()}/preferences`;
|
||||
|
||||
export const searchPrincipals = (params: q.PrincipalSearchParams) => {
|
||||
const { q: query, limit, type } = params;
|
||||
const { q: query, limit, types } = params;
|
||||
let url = `/api/permissions/search-principals?q=${encodeURIComponent(query)}`;
|
||||
|
||||
if (limit !== undefined) {
|
||||
url += `&limit=${limit}`;
|
||||
}
|
||||
|
||||
if (type !== undefined) {
|
||||
url += `&type=${type}`;
|
||||
if (types && types.length > 0) {
|
||||
url += `&types=${types.join(',')}`;
|
||||
}
|
||||
|
||||
return url;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue