Files
freeCodeCamp/api-server/server/models/auth-token.js
Mrugesh Mohapatra 8f0e441644 revert(api): decouple api from curriculum
This reverts commit c077ffe4b9
via PR #40703
2021-02-25 03:40:09 +05:30

16 lines
437 B
JavaScript

import { Observable } from 'rx';
export default function(AuthToken) {
AuthToken.on('dataSourceAttached', () => {
AuthToken.findOne$ = Observable.fromNodeCallback(
AuthToken.findOne.bind(AuthToken)
);
AuthToken.prototype.validate$ = Observable.fromNodeCallback(
AuthToken.prototype.validate
);
AuthToken.prototype.destroy$ = Observable.fromNodeCallback(
AuthToken.prototype.destroy
);
});
}