Mailspring/api/decorators/connections.js

11 lines
325 B
JavaScript
Raw Normal View History

2016-06-19 18:02:32 +08:00
/* eslint func-names:0 */
const DatabaseConnectionFactory = require(`${__base}/core/database-connection-factory`);
module.exports = (server) => {
server.decorate('request', 'getAccountDatabase', function () {
const account = this.auth.credentials;
return DatabaseConnectionFactory.forAccount(account.id);
});
}