We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc50bcf commit a451eb6Copy full SHA for a451eb6
store/mutations.js
@@ -170,10 +170,16 @@ export default {
170
SET_COUNTRIES: (state, data) => {
171
const groupProvinceByCountry = (array, key) => {
172
return array.reduce((result, currentValue) => {
173
- ;(result[currentValue[key]] = result[currentValue[key]] || []).push({
174
- id: currentValue.id,
175
- province: currentValue.province
176
- })
+ if (
+ currentValue.latest.confirmed
+ || currentValue.latest.deaths
+ || currentValue.latest.recovered
177
+ ) {
178
+ ;(result[currentValue[key]] = result[currentValue[key]] || []).push({
179
+ id: currentValue.id,
180
+ province: currentValue.province
181
+ })
182
+ }
183
return result
184
}, {})
185
}
0 commit comments