chore: address ESLint Warnings

This commit is contained in:
Danny Avila 2025-06-09 18:22:02 -04:00
parent 717f61d878
commit e97444a863
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
3 changed files with 57 additions and 46 deletions

View file

@ -1,3 +1,4 @@
const { logger } = require('@librechat/data-schemas');
const { Constants, isAgentsEndpoint } = require('librechat-data-provider');
const { canAccessResource } = require('./canAccessResource');
const { getAgent } = require('~/models/Agent');
@ -82,6 +83,7 @@ const canAccessAgentFromBody = (options) => {
return agentAccessMiddleware(tempReq, res, next);
} catch (error) {
logger.error('Failed to validate agent access permissions', error);
return res.status(500).json({
error: 'Internal Server Error',
message: 'Failed to validate agent access permissions',

View file

@ -683,7 +683,6 @@ describe('PermissionService', () => {
describe('bulkUpdateResourcePermissions', () => {
const otherUserId = new mongoose.Types.ObjectId();
const anotherGroupId = new mongoose.Types.ObjectId();
beforeEach(async () => {
// Setup existing permissions for testing

View file

@ -132,7 +132,9 @@ export function SearchPicker<TOption extends { key: string; value: string }>({
'[pointer-events:auto]', // Override body's pointer-events:none when in modal
)}
>
{isLoading ? (
{(() => {
if (isLoading) {
return (
<div className="space-y-2 p-2">
{Array.from({ length: 3 }).map((_, index) => (
<div key={index} className="flex items-center gap-3 px-3 py-2">
@ -144,15 +146,18 @@ export function SearchPicker<TOption extends { key: string; value: string }>({
</div>
))}
</div>
) : options.length ? (
options.map((o) => (
);
}
if (options.length > 0) {
return options.map((o) => (
<Ariakit.ComboboxItem
key={o.key}
focusOnHover
// hideOnClick
value={o.value}
selectValueOnClick={false}
onClick={(e) => onPickHandler(o)}
onClick={() => onPickHandler(o)}
className={cn(
'flex w-full cursor-pointer items-center px-3 text-sm',
'text-text-primary hover:bg-surface-tertiary',
@ -160,9 +165,11 @@ export function SearchPicker<TOption extends { key: string; value: string }>({
)}
render={renderOptions(o)}
></Ariakit.ComboboxItem>
))
) : (
query.trim().length >= minQueryLengthForNoResults && (
));
}
if (query.trim().length >= minQueryLengthForNoResults) {
return (
<div
className={cn(
'flex items-center justify-center px-4 py-8 text-center',
@ -177,8 +184,11 @@ export function SearchPicker<TOption extends { key: string; value: string }>({
</div>
</div>
</div>
)
)}
);
}
return null;
})()}
</Ariakit.ComboboxPopover>
</Ariakit.ComboboxProvider>
);