diff --git a/apps/meteor/server/api/v1/omnichannel/departments.ts b/apps/meteor/server/api/v1/omnichannel/departments.ts index 577138c399b16..bb5506758b4d7 100644 --- a/apps/meteor/server/api/v1/omnichannel/departments.ts +++ b/apps/meteor/server/api/v1/omnichannel/departments.ts @@ -18,6 +18,7 @@ import { findArchivedDepartments, } from './lib/departments'; import { hasPermissionAsync } from '../../../lib/authorization/hasPermission'; +import { apiDeprecationLogger } from '../../../lib/deprecationWarningLogger'; import { saveDepartment, archiveDepartment, @@ -254,10 +255,16 @@ API.v1.addRoute( return API.v1.failure("The 'selector' param is required"); } + const parsedSelector = JSON.parse(selector); + + if (parsedSelector.conditions && Object.keys(parsedSelector.conditions).length > 0) { + apiDeprecationLogger.parameter(this.route, 'conditions', '9.0.0', this.response); + } + return API.v1.success( await findDepartmentsToAutocomplete({ uid: this.userId, - selector: JSON.parse(selector), + selector: parsedSelector, onlyMyDepartments: onlyMyDepartments === 'true', showArchived: showArchived === 'true', }), diff --git a/apps/meteor/server/api/v1/omnichannel/visitors.ts b/apps/meteor/server/api/v1/omnichannel/visitors.ts index bf96ad8d36193..3b48259b171cc 100644 --- a/apps/meteor/server/api/v1/omnichannel/visitors.ts +++ b/apps/meteor/server/api/v1/omnichannel/visitors.ts @@ -20,6 +20,7 @@ import { findVisitorsByEmailOrPhoneOrNameOrUsernameOrCustomField, } from './lib/visitors'; import { canAccessRoomAsync } from '../../../lib/authorization'; +import { apiDeprecationLogger } from '../../../lib/deprecationWarningLogger'; import { normalizeMessagesForUser } from '../../../lib/utils/lib/normalizeMessagesForUser'; import { getPaginationItems } from '../../lib/getPaginationItems'; @@ -120,10 +121,15 @@ API.v1.addRoute( { async get() { const { selector } = this.queryParams; + const parsedSelector = JSON.parse(selector); + + if (parsedSelector.conditions && Object.keys(parsedSelector.conditions).length > 0) { + apiDeprecationLogger.parameter(this.route, 'conditions', '9.0.0', this.response); + } return API.v1.success( await findVisitorsToAutocomplete({ - selector: JSON.parse(selector), + selector: parsedSelector, }), ); }, diff --git a/apps/meteor/tests/e2e/federation/tests/messaging/threads.spec.ts b/apps/meteor/tests/e2e/federation/tests/messaging/threads.spec.ts index 4972b4c40106c..7a0769275a886 100644 --- a/apps/meteor/tests/e2e/federation/tests/messaging/threads.spec.ts +++ b/apps/meteor/tests/e2e/federation/tests/messaging/threads.spec.ts @@ -8,7 +8,7 @@ import { formatIntoFullMatrixUsername, formatUsernameAndDomainIntoMatrixFormat } import { registerUser } from '../../utils/register-user'; import { test, expect, setupTesting, tearDownTesting } from '../../utils/test'; -test.describe.only('Federation - Threads', () => { +test.describe('Federation - Threads', () => { let poFederationChannelServer1: FederationChannel; let poFederationChannelServer2: FederationChannel; let userFromServer2UsernameOnly: string;