Preserve members and labels when transfer card to another board
parent
ca6efd5b71
commit
35f9631326
@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: (value) => _.isString(value) || _.isArray(value),
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
const cardLabels = await sails.helpers.getCardLabelsForCard(inputs.id);
|
||||
|
||||
const labelIds = sails.helpers.mapRecords(cardLabels, 'labelId', _.isArray(inputs.id));
|
||||
|
||||
return exits.success(labelIds);
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
type: 'json',
|
||||
custom: (value) => _.isString(value) || _.isArray(value),
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
const labelIds = await sails.helpers.getLabelIdsForCard(inputs.id);
|
||||
|
||||
const labels = await sails.helpers.getLabels(labelIds);
|
||||
|
||||
return exits.success(labels);
|
||||
},
|
||||
};
|
||||
@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
inputs: {
|
||||
criteria: {
|
||||
type: 'json',
|
||||
custom: (value) => _.isArray(value) || _.isPlainObject(value),
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
const labels = await Label.find(inputs.criteria).sort('id');
|
||||
|
||||
return exits.success(labels);
|
||||
},
|
||||
};
|
||||
Loading…
Reference in New Issue