Skip to content

Commit

Permalink
Merge pull request #12 from rpkyrych/borysenko
Browse files Browse the repository at this point in the history
KHARKITEC-20: Implementation of adding building from db to frontend
  • Loading branch information
rpkyrych authored Aug 23, 2018
2 parents 8ee89b1 + 7d62f8f commit a60181a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.springframework.web.servlet.ModelAndView;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.*;
Expand Down Expand Up @@ -62,11 +63,11 @@ public ResponseEntity<byte[]> getImage(@PathVariable("id") Long buildingId) thro
@RequestMapping(value = "/{id}", method = GET)
public String getBuilding(@PathVariable long id, Model model) {
try {
model.addAttribute("building", buildingService.getBuilding(id));
model.addAttribute("buildings", Arrays.asList(buildingService.getBuilding(id)));
} catch (ClassNotFoundException e) {
logger.log(Level.ERROR, DB_MARKER, "Finding building in db exception.", e);
}
return ADD_BUILDING_PAGE;
return VIEW_ALL_BUILDINGS_PAGE;
}

@RequestMapping(value = "/", method = POST)
Expand Down

0 comments on commit a60181a

Please sign in to comment.