Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
adding id params for specific routes so we can update through swagger (
Browse files Browse the repository at this point in the history
…#222)

* adding id params for specific routes so we can update through swagger
* linter fixes
  • Loading branch information
bmgdev authored and jedireza committed Jun 7, 2018
1 parent e3e4eb0 commit ad7158f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
27 changes: 27 additions & 0 deletions server/api/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ const register = function (server, serverOptions) {
tags: ['api','accounts'],
description: 'Get a customer account by ID. [Admin Scope]',
notes: 'Get a customer account by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to get the account')
}
},
auth: {
scope: 'admin'
}
Expand Down Expand Up @@ -107,6 +112,9 @@ const register = function (server, serverOptions) {
middle: Joi.string().allow(''),
last: Joi.string().required()
}).required()
},
params: {
id : Joi.string().required().description('the id to update the account')
}
}
},
Expand Down Expand Up @@ -136,6 +144,11 @@ const register = function (server, serverOptions) {
tags: ['api','accounts'],
description: 'Delete a customer account by ID. [Root Scope]',
notes: 'Delete a customer account by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to delete the account')
}
},
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -169,6 +182,9 @@ const register = function (server, serverOptions) {
validate: {
payload: {
username: Joi.string().lowercase().required()
},
params: {
id : Joi.string().required().description('the id to link the account to a user')
}
},
pre: [{
Expand Down Expand Up @@ -231,6 +247,11 @@ const register = function (server, serverOptions) {
tags: ['api','accounts'],
description: 'Unlink a system user to a customer account. [Admin Scope]',
notes: 'Unlink a system user to a customer account.',
validate: {
params: {
id : Joi.string().required().description('the id to unlink a user to account')
}
},
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -291,6 +312,9 @@ const register = function (server, serverOptions) {
validate: {
payload: {
data: Joi.string().required()
},
params: {
id : Joi.string().required().description('the id to add a new note onto an account')
}
}
},
Expand Down Expand Up @@ -334,6 +358,9 @@ const register = function (server, serverOptions) {
validate: {
payload: {
status: Joi.string().required()
},
params: {
id : Joi.string().required().description('the id to update an account status')
}
},
pre: [{
Expand Down
5 changes: 5 additions & 0 deletions server/api/admin-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ const register = function (server, serverOptions) {
tags: ['api','admin-groups'],
description: 'Get an admin group by ID. [Root Scope]',
notes: 'Get an admin group by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to get an admin group')
}
},
auth: {
scope: 'admin'
},
Expand Down
10 changes: 10 additions & 0 deletions server/api/admins.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ const register = function (server, serverOptions) {
tags: ['api','admins'],
description: 'Get an admin account by ID. [Root Scope]',
notes: 'Get an admin account by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to get an admin')
}
},
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -148,6 +153,11 @@ const register = function (server, serverOptions) {
tags: ['api','admins'],
description: 'Delete an admin account by ID. [Root Scope]',
notes: 'Delete an admin account by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to delete an admin')
}
},
auth: {
scope: 'admin'
},
Expand Down
10 changes: 10 additions & 0 deletions server/api/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ const register = function (server, serverOptions) {
tags: ['api','session'],
description: 'Get a user session by ID. [Root Scope]',
notes: 'Get a user session by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to get session')
}
},
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -76,6 +81,11 @@ const register = function (server, serverOptions) {
tags: ['api','session'],
description: 'Delete a user session by ID. [Root Scope]',
notes: 'Delete a user session by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to delete a session')
}
},
auth: {
scope: 'admin'
},
Expand Down
13 changes: 13 additions & 0 deletions server/api/statuses.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ const register = function (server, serverOptions) {
tags: ['api','statuses'],
description: 'Get a status by ID. [Root Scope]',
notes: 'Get a status by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to get status')
}
},
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -109,6 +114,9 @@ const register = function (server, serverOptions) {
validate: {
payload: {
name: Joi.string().required()
},
params: {
id : Joi.string().required().description('the id to update a status')
}
},
pre: [
Expand Down Expand Up @@ -141,6 +149,11 @@ const register = function (server, serverOptions) {
tags: ['api','statuses'],
description: 'Delete a status by ID. [Root Scope]',
notes: 'Delete a status by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to delete a status')
}
},
auth: {
scope: 'admin'
},
Expand Down
5 changes: 5 additions & 0 deletions server/api/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ const register = function (server, serverOptions) {
tags: ['api','users'],
description: 'Get a user by ID. [Root Scope]',
notes: 'Get a user by ID.',
validate: {
params: {
id : Joi.string().required().description('the id to get the user')
}
},
auth: {
scope: 'admin'
},
Expand Down

0 comments on commit ad7158f

Please sign in to comment.