Mailspring/packages/nylas-api/decorators/connections.js
2016-06-22 14:41:32 -07:00

10 lines
295 B
JavaScript

/* eslint func-names:0 */
const {DatabaseConnectionFactory} = require(`nylas-core`);
module.exports = (server) => {
server.decorate('request', 'getAccountDatabase', function () {
const account = this.auth.credentials;
return DatabaseConnectionFactory.forAccount(account.id);
});
}