Skip to content

Commit

Permalink
Merge branch 'feat/single-contact-id' into chore/enable-single-contact
Browse files Browse the repository at this point in the history
  • Loading branch information
tapiarafael authored Oct 16, 2024
2 parents 42208a2 + 47bafeb commit df675ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
11 changes: 0 additions & 11 deletions apps/meteor/ee/server/models/raw/LivechatRooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,4 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo
...extraQuery,
});
}

async setContactIdByVisitorIdOrToken(contactId: string, visitorId: string, visitorToken: string): Promise<UpdateResult | Document> {
return this.updateMany(
{
't': 'l',
'$or': [{ 'v._id': visitorId }, { 'v.token': visitorToken }],
'v.contactId': { $exists: false },
},
{ $set: { 'v.contactId': contactId } },
);
}
}
11 changes: 9 additions & 2 deletions apps/meteor/server/models/raw/LivechatRooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,14 @@ export class LivechatRoomsRaw extends BaseRaw<IOmnichannelRoom> implements ILive
throw new Error('Method not implemented.');
}

setContactIdByVisitorIdOrToken(_contactId: string, _visitorId: string, _visitorToken: string): Promise<UpdateResult | Document> {
throw new Error('Method not implemented.');
setContactIdByVisitorIdOrToken(contactId: string, visitorId: string, visitorToken: string): Promise<UpdateResult | Document> {
return this.updateMany(
{
't': 'l',
'$or': [{ 'v._id': visitorId }, { 'v.token': visitorToken }],
'v.contactId': { $exists: false },
},
{ $set: { 'v.contactId': contactId } },
);
}
}
1 change: 0 additions & 1 deletion apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit df675ec

Please sign in to comment.