Skip to content

Commit

Permalink
Fix script error
Browse files Browse the repository at this point in the history
  • Loading branch information
wiinxt committed Nov 24, 2022
1 parent 07ebf45 commit 71566aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/scripts/fetch-job-offers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
}

Expand Down
9 changes: 9 additions & 0 deletions site/scripts/fetch-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ async function fetchAllCrispConversations({ urlParams }) {
isEndPagination = true
}

if (paginatedData.message) {
console.error('Crisp error : ' + JSON.stringify(paginatedData))
}

dataConversations.push(...(paginatedData || []))
pageCount++
}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 71566aa

Please sign in to comment.