Skip to content

Commit

Permalink
[FIX] Typo in autotranslate method (#15344)
Browse files Browse the repository at this point in the history
  • Loading branch information
Montel authored and ggazzo committed Oct 9, 2019
1 parent 38a3936 commit e37ea63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/api/server/v1/autotranslate.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ API.v1.addRoute('autotranslate.saveSettings', { authRequired: true }, {
return API.v1.failure('The bodyParam "autoTranslate" must be a boolean.');
}
if (field === 'autoTranslateLanguage' && typeof value !== 'string') {
return API.v1.failure('The bodyParam "autoTranslate" must be a string.');
return API.v1.failure('The bodyParam "autoTranslateLanguage" must be a string.');
}

Meteor.runAsUser(this.userId, () => Meteor.call('autoTranslate.saveSettings', roomId, field, value === true ? '1' : String(value).valueOf(), { defaultLanguage }));
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/api/00-autotranslate.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('AutoTranslate', function() {
.expect(400)
.expect((res) => {
expect(res.body).to.have.a.property('success', false);
expect(res.body.error).to.be.equal('The bodyParam "autoTranslate" must be a string.');
expect(res.body.error).to.be.equal('The bodyParam "autoTranslateLanguage" must be a string.');
})
.end(done);
});
Expand Down

0 comments on commit e37ea63

Please sign in to comment.