salix/services/ticket/common/models/ticket-observation.js

10 lines
283 B
JavaScript
Raw Normal View History

const UserError = require('vn-loopback/common/helpers').UserError;
2018-08-30 09:02:50 +00:00
module.exports = Self => {
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError(`The observation type can't be repeated`);
return err;
});
2018-03-16 14:06:42 +00:00
};