Another batch of important updates and fixes

This commit is contained in:
Luka Romih
2026-02-23 15:29:58 +01:00
parent d0e53fee3b
commit fd02e25719
40 changed files with 216 additions and 71 deletions
+16 -5
View File
@@ -123,6 +123,8 @@ consultancy.createQuestion = async (req, res) => {
subject: subjectText,
html: emailHtml
})
// eslint-disable-next-line no-console
console.log(`Sent email to ${emails} (subject: ${subjectText})`)
res.status(201).send()
}
@@ -233,11 +235,14 @@ consultancy.assign = async (req, res) => {
const emailHtml = await renderAsync('email/consultancy-assigned')
// TODO i18n - What language are the email title and content (we already have email translated)
const emailSubject = req.t('Novo terminološko vprašanje')
await email.send({
to: emails,
subject: req.t('Novo terminološko vprašanje'),
subject: emailSubject,
html: emailHtml
})
// eslint-disable-next-line no-console
console.log(`Sent email to ${emails} (subject: ${emailSubject})`)
res.send()
}
@@ -289,11 +294,14 @@ consultancy.sendToReview = async (req, res) => {
const emailHtml = await renderAsync('email/consultancy-item-review')
// TODO i18n - What language are the email title and content (we already have email translated)
const emailSubject = req.t('Potrditev objave')
await email.send({
to: emails,
subject: req.t('Potrditev objave'),
subject: emailSubject,
html: emailHtml
})
// eslint-disable-next-line no-console
console.log(`Sent email to ${emails} (subject: ${emailSubject})`)
res.send()
}
@@ -318,13 +326,16 @@ consultancy.publish = async (req, res) => {
portalName
}
)
const emailSubject = i18next.t('Objava terminološkega vprašanja', {
lng: author.language
})
await email.send({
to: author.email,
subject: i18next.t('Objava terminološkega vprašanja', {
lng: author.language
}),
subject: emailSubject,
html: emailHtml
})
// eslint-disable-next-line no-console
console.log(`Sent email to ${author.email} (subject: ${emailSubject})`)
await ConsultancyEntry.publish(questionId, answerAuthors)
await ConsultancyEntry.indexIntoSearchEngine(questionId, true)