mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Add username to user
This commit is contained in:
parent
1320c697db
commit
ce1e1f741d
143 changed files with 1051 additions and 420 deletions
|
@ -1,12 +1,12 @@
|
|||
const Errors = {
|
||||
CARD_NOT_FOUND: {
|
||||
notFound: 'Card is not found',
|
||||
cardNotFound: 'Card not found',
|
||||
},
|
||||
LABEL_NOT_FOUND: {
|
||||
notFound: 'Label is not found',
|
||||
labelNotFound: 'Label not found',
|
||||
},
|
||||
CARD_LABEL_EXIST: {
|
||||
conflict: 'Card label is already exist',
|
||||
LABEL_ALREADY_IN_CARD: {
|
||||
labelAlreadyInCard: 'Label already in card',
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -25,10 +25,13 @@ module.exports = {
|
|||
},
|
||||
|
||||
exits: {
|
||||
notFound: {
|
||||
cardNotFound: {
|
||||
responseType: 'notFound',
|
||||
},
|
||||
conflict: {
|
||||
labelNotFound: {
|
||||
responseType: 'notFound',
|
||||
},
|
||||
labelAlreadyInCard: {
|
||||
responseType: 'conflict',
|
||||
},
|
||||
},
|
||||
|
@ -38,7 +41,7 @@ module.exports = {
|
|||
|
||||
const { card, project } = await sails.helpers
|
||||
.getCardToProjectPath(inputs.cardId)
|
||||
.intercept('notFound', () => Errors.CARD_NOT_FOUND);
|
||||
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
|
||||
|
||||
const isUserMemberForProject = await sails.helpers.isUserMemberForProject(
|
||||
project.id,
|
||||
|
@ -60,7 +63,7 @@ module.exports = {
|
|||
|
||||
const cardLabel = await sails.helpers
|
||||
.createCardLabel(card, label, this.req)
|
||||
.intercept('conflict', () => Errors.CARD_LABEL_EXIST);
|
||||
.intercept('labelAlreadyInCard', () => Errors.LABEL_ALREADY_IN_CARD);
|
||||
|
||||
return exits.success({
|
||||
item: cardLabel,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue