fix(AccessToken): Move extensions to boot script
Loopback does not facilitate built in model extensions in the same way as user defined models
This commit is contained in:
committed by
mrugesh mohapatra
parent
0682ef33db
commit
8a66886081
15
server/boot/a-extend-built-ins.js
Normal file
15
server/boot/a-extend-built-ins.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Observable } from 'rx';
|
||||
|
||||
export default function extendEmail(app) {
|
||||
const { AccessToken, Email } = app.models;
|
||||
Email.send$ = Observable.fromNodeCallback(Email.send, Email);
|
||||
AccessToken.findOne$ = Observable.fromNodeCallback(
|
||||
AccessToken.findOne.bind(AccessToken)
|
||||
);
|
||||
AccessToken.prototype.validate$ = Observable.fromNodeCallback(
|
||||
AccessToken.prototype.validate
|
||||
);
|
||||
AccessToken.prototype.destroy$ = Observable.fromNodeCallback(
|
||||
AccessToken.prototype.destroy
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user