Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2151-edit_thermograph
This commit is contained in:
commit
dfacb02cdc
|
@ -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}`);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"name": {
|
||||
"type": "String"
|
||||
},
|
||||
"rgb": {
|
||||
"hexColour": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true
|
||||
"type": "Number"
|
||||
},
|
||||
"dmsFk": {
|
||||
"id": true,
|
||||
"type": "Number",
|
||||
"required": true,
|
||||
"mysql": {
|
||||
|
|
Loading…
Reference in New Issue