#8002 adjust to Lilium #3199

Open
jorgep wants to merge 8 commits from 8002-refactorToLilium into dev
1 changed files with 12 additions and 10 deletions
Showing only changes of commit dbf5953d69 - Show all commits

View File

@ -32,21 +32,23 @@ module.exports = Self => {
const userId = ctx.req.accessToken.userId;
const emailUser =
await Self.app.models.EmailUser.findById(userId, {fields: ['email']});
const {code, message, path, request, status, statusText, config: errConfig, name} = additionalData;
let html = `<h2>Motivo: ${reason}</h2>`;
html += `<h3>Usuario: ${userId} ${emailUser.email}</h3>`;
html += `<h3>Additional Data:</h3>`;
html += `<ul><li>Code: ${code}</li>`;
html += `<li>Message: ${message}</li>`;
html += `<li>Path: ${path}</li>`;
html += `<li>Request: ${request}</li>`;
html += `<li>Status: ${status}</li>`;
html += `<li>StatusText: ${statusText}</li>`;
html += `<li>Config:</li><ul style="list-style-type: square;">`;
for (const [key, val] of Object.entries(errConfig)) html += `<li>${key}: ${parse(val)}</li>`;
html += '</ul></ul>';
html += '<ul>';
for (const [key, val] of Object.entries(additionalData)) {
jorgep marked this conversation as resolved Outdated
Outdated
Review

no seria millor fer un for in de les keys de additionalData aixina no cal ficarles a ma?

no seria millor fer un for in de les keys de additionalData aixina no cal ficarles a ma?
if (key !== 'config') html += `<li>${key}: ${parse(val)}</li>`;
else {
html += `<li>${key}:</li><ul style="list-style-type: square;">`;
for (const [confKey, confVal] of Object.entries(val))
html += `<li>${confKey}: ${parse(confVal)}</li>`;
html += '</ul>';
}
}
html += '</ul>';
const {message, path, name} = additionalData;
await smtp.send({
to: `${config.app.reportEmail}, ${emailUser.email}`,
subject: `[Support-Salix] ${path} ${name}: ${message}`,