mirror of
https://github.com/plankanban/planka.git
synced 2025-12-17 09:13:23 +03:00
Add username to user
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user