Skip to content

Commit

Permalink
fix: remove duplicate categories
Browse files Browse the repository at this point in the history
  • Loading branch information
irony committed Mar 29, 2024
1 parent 68531bc commit 545c809
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/discordTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export const scope3Table = async (company: CompanyData) => {
}

const emissions = company.emissions?.sort((a, b) => b.year - a.year)
const categories = emissions
.map((e) => Object.keys(e.scope3?.categories))
.flat()
const categories = [
...new Set(emissions.map((e) => Object.keys(e.scope3?.categories)).flat()),
]

if (!categories.length) {
return '*Ingen Scope 3 data rapporterad*'
Expand Down

0 comments on commit 545c809

Please sign in to comment.