fix: bugs
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-06-03 14:02:23 +02:00
parent e30817644a
commit e4b23fa14d
1 changed files with 9 additions and 9 deletions

View File

@ -92,14 +92,14 @@ module.exports = Self => {
* @return {Promise} - The request promise
*/
Self.sendMessage = async function sendMessage(senderFk, recipient, message) {
// if (process.env.NODE_ENV !== 'production') {
// return new Promise(resolve => {
// return resolve({
// statusCode: 200,
// message: 'Fake notification sent'
// });
// });
// }
if (process.env.NODE_ENV !== 'production') {
return new Promise(resolve => {
return resolve({
statusCode: 200,
message: 'Fake notification sent'
});
});
}
const models = Self.app.models;
const sender = await models.Account.findById(senderFk);
@ -115,7 +115,7 @@ module.exports = Self => {
};
return axios.post(`${login.api}/chat.postMessage`, {
'channel': '@vicent',
'channel': recipient,
'avatar': avatar,
'alias': sender.nickname,
'text': message