mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
28 lines
482 B
JavaScript
28 lines
482 B
JavaScript
module.exports = {
|
|
sync: true,
|
|
|
|
inputs: {
|
|
records: {
|
|
type: 'ref',
|
|
custom: (value) => _.isArray(value),
|
|
required: true,
|
|
},
|
|
attribute: {
|
|
type: 'string',
|
|
defaultsTo: 'id',
|
|
},
|
|
unique: {
|
|
type: 'boolean',
|
|
defaultsTo: false,
|
|
},
|
|
},
|
|
|
|
fn(inputs, exits) {
|
|
let result = _.map(inputs.records, inputs.attribute);
|
|
if (inputs.unique) {
|
|
result = _.uniq(result);
|
|
}
|
|
|
|
return exits.success(result);
|
|
},
|
|
};
|