2018-10-03 07:37:34 +00:00
|
|
|
const LoopBackContext = require('loopback-context');
|
|
|
|
|
|
|
|
module.exports = function(Self) {
|
|
|
|
Self.setup = function() {
|
|
|
|
Self.super_.setup.call(this);
|
|
|
|
};
|
|
|
|
|
|
|
|
Self.observe('before save', async function(ctx) {
|
2023-01-26 14:49:30 +00:00
|
|
|
ctx.options.httpCtx = LoopBackContext.getCurrentContext();
|
2023-01-11 12:24:55 +00:00
|
|
|
});
|
2023-01-10 14:24:22 +00:00
|
|
|
|
2018-10-18 09:11:17 +00:00
|
|
|
Self.observe('before delete', async function(ctx) {
|
2023-01-26 14:49:30 +00:00
|
|
|
ctx.options.httpCtx = LoopBackContext.getCurrentContext();
|
2018-10-03 07:37:34 +00:00
|
|
|
});
|
|
|
|
};
|