mdsb100 / cli-gitlab

GitLab CLI library
101 stars 11 forks source link

addGroupMember throws error #14

Closed LordPsyan closed 7 years ago

LordPsyan commented 7 years ago

While testing commands, I created a user named Psyanide. I tried the command line for many of the commands, and so far all work except addGroupMember.

my command: gitlab addGroupMember 4 3 30 explanation: 4 = Psyanide, 3 = LordPsyanGroup, 30 = DEVELOPER

I get this error (I have tried many variations, and same error. I have searched everywhere for the answer): ` gitlab addGroupMember 4 3 30

/usr/lib/node_modules/cli-gitlab/node_modules/gitlab/lib/Models/Groups.js:139 throw "accessLevel must be one of " + (JSON.stringify(this.access_levels)); ^ accessLevel must be one of {"GUEST":10,"REPORTER":20,"DEVELOPER":30,"MASTER":40,"OWNER":50} `

I cannot figure out exactly how to state accessLevel. Maybe adding something to the documentation might help.

mdsb100 commented 7 years ago

I will see and fix it as soon as possible.

mdsb100 commented 7 years ago

the issue is 'string === number'

if (accessLevel === access_level) {
   return true;
}
mdsb100 commented 7 years ago

publish 1.5.2 to fix it @LordPsyan