mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Changed the logic to catch error send by Klicktipp.
This commit is contained in:
parent
3fdb503ea6
commit
a1b54e592e
@ -24,9 +24,13 @@ export const klicktippNewsletterStateMiddleware: MiddlewareFn = async (
|
||||
const result = await next()
|
||||
let klickTipp = new KlickTipp({ status: 'Unsubscribed' })
|
||||
if (CONFIG.KLICKTIPP) {
|
||||
const klickTippUser = await getKlickTippUser(result.email)
|
||||
if (klickTippUser) {
|
||||
klickTipp = new KlickTipp(klickTippUser)
|
||||
try {
|
||||
const klickTippUser = await getKlickTippUser(result.email)
|
||||
if (klickTippUser) {
|
||||
klickTipp = new KlickTipp(klickTippUser)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Something went wrong', err)
|
||||
}
|
||||
}
|
||||
result.klickTipp = klickTipp
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user