#1057 modificar el component vn-user-configuration
This commit is contained in:
parent
d714c34f59
commit
519350442f
|
@ -13,8 +13,19 @@ module.exports = function(Self) {
|
|||
});
|
||||
|
||||
Self.getUserConfig = async ctx => {
|
||||
return await Self.app.models.UserConfig.findOne({
|
||||
let userConfig = await Self.app.models.UserConfig.findOne({
|
||||
where: {userFk: ctx.req.accessToken.userId}
|
||||
});
|
||||
|
||||
if (!userConfig) {
|
||||
let newConfig = {
|
||||
warehouseFk: 1,
|
||||
companyFk: 442,
|
||||
userFk: ctx.req.accessToken.userId
|
||||
};
|
||||
|
||||
userConfig = await Self.app.models.UserConfig.create(newConfig);
|
||||
}
|
||||
return userConfig;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue