Prevent resolving users if list is empty
This commit is contained in:
@@ -32,7 +32,10 @@ export default {
|
||||
// Dispatch resolution per module
|
||||
return Promise.all(Object.entries(moduleRecords).map(([moduleID, recordIDs]) => {
|
||||
recordIDs = [...recordIDs]
|
||||
return this.$store.dispatch('record/resolveRecords', { namespaceID, moduleID, recordIDs })
|
||||
|
||||
if (recordIDs.length) {
|
||||
return this.$store.dispatch('record/resolveRecords', { namespaceID, moduleID, recordIDs })
|
||||
}
|
||||
}))
|
||||
},
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
const list = new Set(records.map(r => {
|
||||
const list = [...new Set(records.map(r => {
|
||||
return fields
|
||||
.filter(c => c.kind === 'User')
|
||||
.map(f => {
|
||||
@@ -15,9 +15,11 @@ export default {
|
||||
return f.isMulti ? r.values[f.name] : [r.values[f.name]]
|
||||
}
|
||||
})
|
||||
}).flat(Infinity))
|
||||
}).flat(Infinity))]
|
||||
|
||||
return this.$store.dispatch('user/resolveUsers', [...list])
|
||||
if (list.length) {
|
||||
return this.$store.dispatch('user/resolveUsers', list)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user