1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00
planka/server/api/helpers/delete-card-label.js

32 lines
546 B
JavaScript

module.exports = {
inputs: {
record: {
type: 'ref',
required: true,
},
board: {
type: 'ref',
required: true,
},
request: {
type: 'ref',
},
},
async fn(inputs, exits) {
const cardLabel = await CardLabel.destroyOne(inputs.record.id);
if (cardLabel) {
sails.sockets.broadcast(
`board:${inputs.board.id}`,
'cardLabelDelete',
{
item: cardLabel,
},
inputs.request,
);
}
return exits.success(cardLabel);
},
};