refs #5666 feat: create mixin

This commit is contained in:
Javier Segarra 2023-11-10 15:12:24 +01:00
parent 5dbfe31a60
commit cf3cc37d97
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
const loggable = require('vn-loopback/util/log');
module.exports = function(Self, options) {
Self.once('attached', function(ctx) {
});
Self.observe('before save', async function(ctx, next) {
await loggable.translateValues(Self, ctx.currentInstance);
});
let Mixin = {
};
for (let method in Mixin) {
if (!Self.prototype[method])
Self.prototype[method] = Mixin[method];
}
};