salix/modules/travel/back/models/travel.js

17 lines
593 B
JavaScript
Raw Normal View History

2020-03-10 13:09:26 +00:00
const UserError = require('vn-loopback/util/user-error');
2019-10-24 10:49:18 +00:00
module.exports = Self => {
require('../methods/travel/getTravel')(Self);
require('../methods/travel/getEntries')(Self);
2019-12-20 06:55:00 +00:00
require('../methods/travel/filter')(Self);
require('../methods/travel/createThermograph')(Self);
require('../methods/travel/deleteThermograph')(Self);
2020-02-28 13:18:55 +00:00
require('../methods/travel/updateThermograph')(Self);
2020-03-10 13:09:26 +00:00
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError('The introduced data already exists');
return err;
});
2019-10-24 10:49:18 +00:00
};