Closed eternalflamez closed 3 years ago
For instance:
App.callmodule('collections:findOne', [field.options.link, filter]).then(function(data) {
if (data.result && data.result._id) {
//TODO add support for multiple imports
var entry = {_id:data.result._id, display: data.result[field.options.display] || data.result[Filter.collections[field.options.link].fields[0].name] || 'n/a'};
$this.resolve(field.options.multiple ? [entry]:entry);
} else {
console.log("Couldn't find a collection reference for "+value);
$this.resolve(null);
}
})
.catch(() => {
console.log("Couldn't find a collection reference for "+value);
$this.resolve(null);
});
This is due to this findOne call not actually resolving on error, adding a .catch to this block would solve the issue:
https://github.com/agentejo/cockpit/blob/49233716d28571f771655a732640c8895f15736a/modules/Collections/assets/import/filter.js#L131