Skip to content

Commit

Permalink
[SHIBUI-580]
Browse files Browse the repository at this point in the history
Added a name conflict check.
  • Loading branch information
Bill Smith committed Jul 5, 2018
1 parent 2f1e1d7 commit 382294a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public ResponseEntity<?> getOne(@PathVariable String resourceId) {
@PostMapping("/MetadataResolvers")
@Transactional
public ResponseEntity<?> create(@RequestBody MetadataResolver newResolver) {
if (resolverRepository.findByName(newResolver.getName()) != null) {
return ResponseEntity.status(HttpStatus.CONFLICT).build();
}

//TODO: we are disregarding attached filters if any sent from UI.
//Only deal with filters via filters endpoints?
newResolver.clearAllFilters();
Expand Down

0 comments on commit 382294a

Please sign in to comment.