#5666 - Loggable to mixin #1826

Merged
alexm merged 29 commits from 5666-loggable_to_mixin into dev 2024-01-04 09:21:57 +00:00
1 changed files with 20 additions and 0 deletions
Showing only changes of commit cf3cc37d97 - Show all commits

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];
}
};