ResponseEntity updateOffice()

in service/src/main/java/org/apache/fineract/cn/office/rest/controller/OfficeRestController.java [162:174]


  ResponseEntity<Void> updateOffice(@PathVariable("identifier") final String identifier,
                                    @RequestBody @Valid final Office office) throws InterruptedException {
    if (!this.officeService.officeExists(identifier)) {
      throw ServiceException.notFound("Office {0} not found.", identifier);
    }

    if (office.getIdentifier() != null && !identifier.equals(office.getIdentifier())) {
      throw ServiceException.badRequest("Office identifier must match resource identifier");
    }

    this.commandGateway.process(new UpdateOfficeCommand(office));
    return ResponseEntity.accepted().build();
  }