feat(user): added userConfig.darkMode relation towards account.user
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
91f111f609
commit
8efcb6233f
|
@ -23,7 +23,13 @@ module.exports = Self => {
|
||||||
let models = Self.app.models;
|
let models = Self.app.models;
|
||||||
|
|
||||||
let user = await models.Account.findById(userId, {
|
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({
|
let roles = await models.RoleMapping.find({
|
||||||
|
|
|
@ -71,6 +71,11 @@
|
||||||
"type": "hasOne",
|
"type": "hasOne",
|
||||||
"model": "Worker",
|
"model": "Worker",
|
||||||
"foreignKey": "userFk"
|
"foreignKey": "userFk"
|
||||||
|
},
|
||||||
|
"userConfig": {
|
||||||
|
"type": "hasOne",
|
||||||
|
"model": "UserConfig",
|
||||||
|
"foreignKey": "userFk"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"acls": [
|
"acls": [
|
||||||
|
|
|
@ -9,20 +9,23 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"userFk": {
|
"userFk": {
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "Number",
|
"type": "number",
|
||||||
"required": true
|
"required": true
|
||||||
},
|
},
|
||||||
"warehouseFk": {
|
"warehouseFk": {
|
||||||
"type": "Number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"companyFk": {
|
"companyFk": {
|
||||||
"type": "Number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"created": {
|
"created": {
|
||||||
"type": "Date"
|
"type": "date"
|
||||||
},
|
},
|
||||||
"updated": {
|
"updated": {
|
||||||
"type": "Date"
|
"type": "date"
|
||||||
|
},
|
||||||
|
"darkMode": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"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