salix/modules/account/back/models/sip-config.js

19 lines
477 B
JavaScript
Raw Normal View History

const app = require('vn-loopback/server/server');
module.exports = Self => {
Self.getLinker = async function() {
return await Self.findOne({fields: ['id']});
};
Object.assign(Self.prototype, {
async syncUser(userName, info, password) {
if (!info.hasAccount || !password) return;
await app.models.VnUser.rawSql('CALL pbx.sip_setPassword(?, ?)',
[info.user.id, password]
);
}
});
};