Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2151-edit_thermograph

This commit is contained in:
Joan Sanchez 2020-02-28 09:08:01 +01:00
commit dfacb02cdc
3 changed files with 8 additions and 4 deletions

View File

@ -26,6 +26,10 @@ module.exports = Self => {
Self.sendCheckingPresence = async(ctx, workerId, message) => {
const models = Self.app.models;
const account = await models.Account.findById(workerId);
const userId = ctx.req.accessToken.userId;
if (!account)
throw new Error(`Could not send message "${message}" to worker id ${workerId} from user ${userId}`);
const query = `SELECT worker_isWorking(?) isWorking`;
const [result] = await Self.rawSql(query, [workerId]);
@ -37,7 +41,7 @@ module.exports = Self => {
}
});
const department = workerDepartment && workerDepartment.department();
const channelName = department.chatName;
const channelName = department && department.chatName;
if (channelName)
return Self.send(ctx, `#${channelName}`, `@${account.name} => ${message}`);

View File

@ -14,7 +14,7 @@
"name": {
"type": "String"
},
"rgb": {
"hexColour": {
"type": "String"
}
},

View File

@ -13,10 +13,10 @@
},
"properties": {
"id": {
"type": "Number",
"id": true
"type": "Number"
},
"dmsFk": {
"id": true,
"type": "Number",
"required": true,
"mysql": {