mirror of
https://github.com/plankanban/planka.git
synced 2025-07-22 14:49:43 +02:00
Add username to user
This commit is contained in:
parent
ec222a5e32
commit
af00e3e191
143 changed files with 1051 additions and 420 deletions
|
@ -1,12 +1,12 @@
|
|||
const Errors = {
|
||||
PROJECT_NOT_FOUND: {
|
||||
notFound: 'Project is not found',
|
||||
projectNotFound: 'Project not found',
|
||||
},
|
||||
USER_NOT_FOUND: {
|
||||
notFound: 'User is not found',
|
||||
userNotFound: 'User not found',
|
||||
},
|
||||
PROJECT_MEMBERSHIP_EXIST: {
|
||||
conflict: 'Project membership is already exist',
|
||||
USER_ALREADY_PROJECT_MEMBER: {
|
||||
userAlreadyProjectMember: 'User already project member',
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -25,10 +25,13 @@ module.exports = {
|
|||
},
|
||||
|
||||
exits: {
|
||||
notFound: {
|
||||
projectNotFound: {
|
||||
responseType: 'notFound',
|
||||
},
|
||||
conflict: {
|
||||
userNotFound: {
|
||||
responseType: 'notFound',
|
||||
},
|
||||
userAlreadyProjectMember: {
|
||||
responseType: 'conflict',
|
||||
},
|
||||
},
|
||||
|
@ -48,7 +51,7 @@ module.exports = {
|
|||
|
||||
const projectMembership = await sails.helpers
|
||||
.createProjectMembership(project, user, this.req)
|
||||
.intercept('conflict', () => Errors.PROJECT_MEMBERSHIP_EXIST);
|
||||
.intercept('userAlreadyProjectMember', () => Errors.USER_ALREADY_PROJECT_MEMBER);
|
||||
|
||||
return exits.success({
|
||||
item: projectMembership,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue