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

View file

@ -683,7 +683,6 @@ describe('PermissionService', () => {
describe('bulkUpdateResourcePermissions', () => { describe('bulkUpdateResourcePermissions', () => {
const otherUserId = new mongoose.Types.ObjectId(); const otherUserId = new mongoose.Types.ObjectId();
const anotherGroupId = new mongoose.Types.ObjectId();
beforeEach(async () => { beforeEach(async () => {
// Setup existing permissions for testing // 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 '[pointer-events:auto]', // Override body's pointer-events:none when in modal
)} )}
> >
{isLoading ? ( {(() => {
if (isLoading) {
return (
<div className="space-y-2 p-2"> <div className="space-y-2 p-2">
{Array.from({ length: 3 }).map((_, index) => ( {Array.from({ length: 3 }).map((_, index) => (
<div key={index} className="flex items-center gap-3 px-3 py-2"> <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>
))} ))}
</div> </div>
) : options.length ? ( );
options.map((o) => ( }
if (options.length > 0) {
return options.map((o) => (
<Ariakit.ComboboxItem <Ariakit.ComboboxItem
key={o.key} key={o.key}
focusOnHover focusOnHover
// hideOnClick // hideOnClick
value={o.value} value={o.value}
selectValueOnClick={false} selectValueOnClick={false}
onClick={(e) => onPickHandler(o)} onClick={() => onPickHandler(o)}
className={cn( className={cn(
'flex w-full cursor-pointer items-center px-3 text-sm', 'flex w-full cursor-pointer items-center px-3 text-sm',
'text-text-primary hover:bg-surface-tertiary', 'text-text-primary hover:bg-surface-tertiary',
@ -160,9 +165,11 @@ export function SearchPicker<TOption extends { key: string; value: string }>({
)} )}
render={renderOptions(o)} render={renderOptions(o)}
></Ariakit.ComboboxItem> ></Ariakit.ComboboxItem>
)) ));
) : ( }
query.trim().length >= minQueryLengthForNoResults && (
if (query.trim().length >= minQueryLengthForNoResults) {
return (
<div <div
className={cn( className={cn(
'flex items-center justify-center px-4 py-8 text-center', '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> </div>
</div> </div>
) );
)} }
return null;
})()}
</Ariakit.ComboboxPopover> </Ariakit.ComboboxPopover>
</Ariakit.ComboboxProvider> </Ariakit.ComboboxProvider>
); );