Fix script error

pull/2413/head
Jérémy Rialland 2022-11-24 19:19:02 +01:00 committed by Jérémy Rialland
parent 4c1f2db7ae
commit 75c0f2d292
2 changed files with 13 additions and 1 deletions

View File

@ -24,7 +24,9 @@ async function fetchJobOffers() {
// The XML API isn't the most ergonomic, we ought to have a JSON API.
// cf. https://github.com/betagouv/beta.gouv.fr/issues/6343
jobOffers = (await parseXML(content)).feed.entry
const xml = await parseXML(content)
jobOffers = xml.feed.entry
.map((entry) => ({
title: entry.title[0]['_'].trim(),
link: entry.link[0].$.href,
@ -36,6 +38,7 @@ async function fetchJobOffers() {
title: title.replace(' - Offre de Mon-entreprise', ''),
}))
} catch (err) {
console.error('Beta.gouv.fr/jobs error : ')
console.error(err)
}

View File

@ -395,6 +395,10 @@ async function fetchAllCrispConversations({ urlParams }) {
isEndPagination = true
}
if (paginatedData.message) {
console.error('Crisp error : ' + JSON.stringify(paginatedData))
}
dataConversations.push(...(paginatedData || []))
pageCount++
}
@ -507,6 +511,11 @@ async function fetchZammadUserFeedbackIssues() {
}),
}
).then((r) => r.json())
if (tags.error) {
console.error('Zammad error: ' + JSON.stringify(tags))
}
const issues = tags.filter(({ name }) => /#[\d]+/.exec(name))
return issues.reduce(