Make description param optional on create roles
This commit is contained in:
parent
c5331d5934
commit
8d5e21f3a2
|
@ -39,7 +39,7 @@ public class CuratorController {
|
||||||
* Create a new Curator role (only for admins)
|
* Create a new Curator role (only for admins)
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/{type}/create", method = RequestMethod.POST)
|
@RequestMapping(value = "/{type}/create", method = RequestMethod.POST)
|
||||||
public ResponseEntity<Response> createRole(@PathVariable("type") String type, @RequestParam("description") String description) {
|
public ResponseEntity<Response> createRole(@PathVariable("type") String type, @RequestParam(value = "description", required = false) String description) {
|
||||||
if (registryService.getCouId(AuthoritiesUtils.curatorRole(type).toLowerCase()) == null) {
|
if (registryService.getCouId(AuthoritiesUtils.curatorRole(type).toLowerCase()) == null) {
|
||||||
if (registryService.createRole(AuthoritiesUtils.curatorRole(type), description != null ? description : "") != null) {
|
if (registryService.createRole(AuthoritiesUtils.curatorRole(type), description != null ? description : "") != null) {
|
||||||
return ResponseEntity.ok(new Response("Role has been created successfully"));
|
return ResponseEntity.ok(new Response("Role has been created successfully"));
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class MemberController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/{type}/{id}/create", method = RequestMethod.POST)
|
@RequestMapping(value = "/{type}/{id}/create", method = RequestMethod.POST)
|
||||||
public ResponseEntity<Response> createGroup(@PathVariable("type") String type, @PathVariable("id") String id,
|
public ResponseEntity<Response> createGroup(@PathVariable("type") String type, @PathVariable("id") String id,
|
||||||
@RequestParam("description") String description) {
|
@RequestParam(value = "description", required = false) String description) {
|
||||||
if (registryService.getCouId(AuthoritiesUtils.memberRole(type, id)) == null) {
|
if (registryService.getCouId(AuthoritiesUtils.memberRole(type, id)) == null) {
|
||||||
if (registryService.createRole(AuthoritiesUtils.memberRole(type, id), description != null ? description : "") != null) {
|
if (registryService.createRole(AuthoritiesUtils.memberRole(type, id), description != null ? description : "") != null) {
|
||||||
return ResponseEntity.ok(new Response("Role has been created successfully"));
|
return ResponseEntity.ok(new Response("Role has been created successfully"));
|
||||||
|
|
Loading…
Reference in New Issue