Merge pull request 'feat(user): added userConfig.darkMode relation towards account.user' (#943) from 3904-user_dark_mode into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #943 Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
commit
bd0164dd4e
|
@ -23,7 +23,13 @@ module.exports = Self => {
|
|||
let models = Self.app.models;
|
||||
|
||||
let user = await models.Account.findById(userId, {
|
||||
fields: ['id', 'name', 'nickname', 'email']
|
||||
fields: ['id', 'name', 'nickname', 'email', 'lang'],
|
||||
include: {
|
||||
relation: 'userConfig',
|
||||
scope: {
|
||||
fields: ['darkMode']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let roles = await models.RoleMapping.find({
|
||||
|
|
|
@ -71,6 +71,11 @@
|
|||
"type": "hasOne",
|
||||
"model": "Worker",
|
||||
"foreignKey": "userFk"
|
||||
},
|
||||
"userConfig": {
|
||||
"type": "hasOne",
|
||||
"model": "UserConfig",
|
||||
"foreignKey": "userFk"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
|
|
@ -9,20 +9,23 @@
|
|||
"properties": {
|
||||
"userFk": {
|
||||
"id": true,
|
||||
"type": "Number",
|
||||
"type": "number",
|
||||
"required": true
|
||||
},
|
||||
"warehouseFk": {
|
||||
"type": "Number"
|
||||
"type": "number"
|
||||
},
|
||||
"companyFk": {
|
||||
"type": "Number"
|
||||
"type": "number"
|
||||
},
|
||||
"created": {
|
||||
"type": "Date"
|
||||
"type": "date"
|
||||
},
|
||||
"updated": {
|
||||
"type": "Date"
|
||||
"type": "date"
|
||||
},
|
||||
"darkMode": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `vn`.`userConfig` ADD darkMode tinyint(1) DEFAULT 1 NOT NULL COMMENT 'Salix interface dark mode';
|
Loading…
Reference in New Issue