diff --git a/apps/meteor/ee/server/models/raw/LivechatRooms.ts b/apps/meteor/ee/server/models/raw/LivechatRooms.ts index 2e4c8606d301..5b89704a522c 100644 --- a/apps/meteor/ee/server/models/raw/LivechatRooms.ts +++ b/apps/meteor/ee/server/models/raw/LivechatRooms.ts @@ -726,15 +726,4 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo ...extraQuery, }); } - - async setContactIdByVisitorIdOrToken(contactId: string, visitorId: string, visitorToken: string): Promise { - return this.updateMany( - { - 't': 'l', - '$or': [{ 'v._id': visitorId }, { 'v.token': visitorToken }], - 'v.contactId': { $exists: false }, - }, - { $set: { 'v.contactId': contactId } }, - ); - } } diff --git a/apps/meteor/server/models/raw/LivechatRooms.ts b/apps/meteor/server/models/raw/LivechatRooms.ts index 570ae5469a7d..f4f611cec6fc 100644 --- a/apps/meteor/server/models/raw/LivechatRooms.ts +++ b/apps/meteor/server/models/raw/LivechatRooms.ts @@ -2754,7 +2754,14 @@ export class LivechatRoomsRaw extends BaseRaw implements ILive throw new Error('Method not implemented.'); } - setContactIdByVisitorIdOrToken(_contactId: string, _visitorId: string, _visitorToken: string): Promise { - throw new Error('Method not implemented.'); + setContactIdByVisitorIdOrToken(contactId: string, visitorId: string, visitorToken: string): Promise { + return this.updateMany( + { + 't': 'l', + '$or': [{ 'v._id': visitorId }, { 'v.token': visitorToken }], + 'v.contactId': { $exists: false }, + }, + { $set: { 'v.contactId': contactId } }, + ); } } diff --git a/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts b/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts index 31134412b8ec..889f497bb209 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts @@ -56,7 +56,6 @@ describe('LIVECHAT - visitors', () => { expect(body).to.have.property('success', true); expect(body).to.have.property('visitor'); expect(body.visitor).to.have.property('token', 'test'); - expect(body.visitor).to.have.property('contactId'); // Ensure all new visitors are created as online :) expect(body.visitor).to.have.property('status', 'online');