Skip to content

Commit

Permalink
Adiciona iptKingdoms às ocorrências
Browse files Browse the repository at this point in the history
Closes #65
  • Loading branch information
Phenome committed Mar 13, 2024
1 parent f32ca2c commit 3a6c1a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ocorrencia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ await Promise.all([
name: 'ipt'
},
{ key: { canonicalName: 1 }, name: 'canonicalName' },
{ key: { flatScientificName: 1 }, name: 'flatScientificName' }
{ key: { flatScientificName: 1 }, name: 'flatScientificName' },
{ key: { iptKingdoms: 1 }, name: 'iptKingdoms' }
]),
iptsCol.createIndexes([
{
Expand Down Expand Up @@ -148,10 +149,12 @@ for (const { repositorio, kingdom, tag, url } of iptSources) {
]
.filter(Boolean)
.join(' ')
const iptKingdoms = kingdom.split(/, ?/)
return {
iptId: ipt.id,
ipt: repositorio,
canonicalName,
iptKingdoms,
flatScientificName: (
(ocorrencia[1].scientificName as string) ?? canonicalName
)
Expand Down

0 comments on commit 3a6c1a3

Please sign in to comment.