@@ -138,8 +138,8 @@ const defs = {
138138 authorize : withAdminSession ,
139139 fn : ( _ctx , project ) => ProjectsCollection . insert ( project ) ,
140140 input : OBJ ( {
141- projectSlug : STR ( 'The unique identifier for the project' ) ,
142- projectName : STR ( 'The name of the project' ) ,
141+ slug : STR ( 'The unique identifier for the project' ) ,
142+ name : STR ( 'The name of the project' ) ,
143143 teamId : STR ( 'The ID of the team that owns the project' ) ,
144144 isPublic : BOOL ( 'Is the project public?' ) ,
145145 repositoryUrl : optional ( STR ( 'The URL of the project repository' ) ) ,
@@ -149,21 +149,21 @@ const defs = {
149149 } ) ,
150150 'GET/api/project' : route ( {
151151 authorize : withUserSession ,
152- fn : ( _ctx , { projectSlug } ) => {
153- const project = ProjectsCollection . get ( projectSlug )
152+ fn : ( _ctx , { slug } ) => {
153+ const project = ProjectsCollection . get ( slug )
154154 if ( ! project ) throw respond . NotFound ( { message : 'Project not found' } )
155155 return project
156156 } ,
157- input : OBJ ( { projectSlug : STR ( 'The slug of the project' ) } ) ,
157+ input : OBJ ( { slug : STR ( 'The slug of the project' ) } ) ,
158158 output : ProjectDef ,
159159 description : 'Get a project by ID' ,
160160 } ) ,
161161 'PUT/api/project' : route ( {
162162 authorize : withAdminSession ,
163- fn : ( _ctx , input ) => ProjectsCollection . update ( input . projectSlug , input ) ,
163+ fn : ( _ctx , input ) => ProjectsCollection . update ( input . slug , input ) ,
164164 input : OBJ ( {
165- projectSlug : STR ( 'The unique identifier for the project' ) ,
166- projectName : STR ( 'The name of the project' ) ,
165+ slug : STR ( 'The unique identifier for the project' ) ,
166+ name : STR ( 'The name of the project' ) ,
167167 teamId : STR ( 'The ID of the team that owns the project' ) ,
168168 isPublic : BOOL ( 'Is the project public?' ) ,
169169 repositoryUrl : optional ( STR ( 'The URL of the project repository' ) ) ,
@@ -173,13 +173,13 @@ const defs = {
173173 } ) ,
174174 'DELETE/api/project' : route ( {
175175 authorize : withAdminSession ,
176- fn : ( _ctx , { projectSlug } ) => {
177- const project = ProjectsCollection . get ( projectSlug )
176+ fn : ( _ctx , { slug } ) => {
177+ const project = ProjectsCollection . get ( slug )
178178 if ( ! project ) throw respond . NotFound ( { message : 'Project not found' } )
179- ProjectsCollection . delete ( projectSlug )
179+ ProjectsCollection . delete ( slug )
180180 return true
181181 } ,
182- input : OBJ ( { projectSlug : STR ( 'The slug of the project' ) } ) ,
182+ input : OBJ ( { slug : STR ( 'The slug of the project' ) } ) ,
183183 output : BOOL ( 'Indicates if the project was deleted' ) ,
184184 description : 'Delete a project by ID' ,
185185 } ) ,
0 commit comments