diff --git a/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java b/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java index dfd47743b..4055e5fc4 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/CatchmentController.java @@ -148,6 +148,7 @@ public ResponseEntity voidCatchment(@PathVariable("id") Long id) { return ResponseEntity.badRequest().body(ReactAdminUtil.generateJsonError(String.format("AddressLevelType with id %d not found", id))); } catchment.setVoided(true); + catchment.setName(ReactAdminUtil.getVoidedName(catchment.getName(),catchment.getId())); catchmentRepository.save(catchment); return new ResponseEntity<>(CatchmentContract.fromEntity(catchment), HttpStatus.OK); } diff --git a/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java b/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java index 3cf83bed5..2d823b0a8 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/GroupsController.java @@ -9,6 +9,7 @@ import org.avni.server.framework.security.UserContextHolder; import org.avni.server.service.GroupsService; import org.avni.server.service.accessControl.AccessControlService; +import org.avni.server.util.ReactAdminUtil; import org.avni.server.web.request.GroupContract; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -124,6 +125,7 @@ public ResponseEntity voidGroup(@PathVariable("id") Long id) { return ResponseEntity.badRequest().body(String.format("Default group %s cannot be deleted", group.getName())); group.setVoided(true); + group.setName((ReactAdminUtil.getVoidedName(group.getName(), group.getId()))); group.updateAudit(); groupRepository.save(group);