Commit 771415e2 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt
Browse files

chore: simplify choice generation

parent 674c8867
Pipeline #1845 passed with stage
in 1 minute and 43 seconds
......@@ -123,25 +123,14 @@
},
showTypeSelector: function () {
let options = []
for (let i in this.types) {
options.push({
value: this.types[i].id,
text: this.types[i].type
})
}
return options
return this.types.map(({type, id}) => ({text: type, value: id }))
},
showFundingCategorySelector: function () {
let options = []
for (let i in this.fundingcategories) {
options.push({
value: this.fundingcategories[i].id,
text: this.fundingcategories[i].abbrev + ' (' + this.fundingcategories[i].fundingcategory + ')'
})
}
return options
return this.fundingcategories.map(({id, abbrev, fundingcategory}) => ({
value: id,
text: `${abbrev} (${fundingcategory})`
}))
},
...mapGetters({
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment