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

20 lines
522 B
JavaScript

module.exports = function(Self) {
/* Self.validateAsync('observationTypeFk', validateObservationUniqueness, {
message: `The observation type can't be repeated`
});
async function validateObservationUniqueness(err, done) {
let observationExists = await Self.findOne({
where: {
ticketFk: this.ticketFk,
observationTypeFk: this.observationTypeFk
}
});
if (observationExists)
err();
done();
} */
};