🔧 fix: Express v5 Optional chaining for endpoint retrieval in Assistants Controllers (#10946)

- Updated endpoint retrieval logic in `helpers.js` and `v1.js` to use optional chaining for safer access to request body and query parameters, enhancing code robustness.
This commit is contained in:
Danny Avila 2025-12-12 14:04:28 -05:00 committed by GitHub
parent e15d37b399
commit 959e301f99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -259,7 +259,7 @@ function filterAssistantDocs({ documents, userId, assistantsConfig = {} }) {
const getAssistantDocuments = async (req, res) => {
try {
const appConfig = req.config;
const endpoint = req.query;
const endpoint = req.query?.endpoint;
const assistantsConfig = appConfig.endpoints?.[endpoint];
const documents = await getAssistants(
{},