Skip to content

Commit

Permalink
fix: check if app is running on test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tapiarafael committed Aug 22, 2024
1 parent 55d68af commit e32f916
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/meteor/app/livechat/server/api/v1/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ API.v1.addRoute(
{ authRequired: true, permissionsRequired: ['create-livechat-contact'], validateParams: isPOSTOmnichannelContactsProps },
{
async post() {
if (!process.env.TEST_MODE) {
throw new Meteor.Error('error-not-allowed', 'This endpoint is only allowed in test mode');
}
const contactId = await createContact({ ...this.bodyParams, unknown: false });

return API.v1.success({ contactId });
Expand Down

0 comments on commit e32f916

Please sign in to comment.