Skip to content

Commit

Permalink
fixed backend call for adding tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gearwheel01 committed Jun 14, 2021
1 parent f021941 commit b473b1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ public int insertNewShortURLWithTarget(@RequestBody POST_ShortURLWithTargetAndTa
}

for(int tagId: assignedTagIds){
if(this.url_has_tagRepo.saveTagOfGroupToShortURLBySuffix(tagId, body.getGroup_name(), body.getCustom_suffix()) != 1)
String suffix = body.getCustom_suffix();
if(this.url_has_tagRepo.saveTagOfGroupToShortURLBySuffix(tagId, body.getGroup_name(), suffix) != 1) {
return HttpStatus.BAD_REQUEST.value();
}
}

return HttpStatus.CREATED.value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface Url_has_tagRepo extends JpaRepository<Url_has_tag, Composite_ur
"VALUES ((" +
"SELECT id " +
"FROM short_url " +
"WHERE group_name = :searched_group_name AND custom_suffix = :searched_custom_suffix;" +
"WHERE group_name = :searched_group_name AND custom_suffix = :searched_custom_suffix" +
"), (" +
"SELECT id " +
"FROM tag " +
Expand Down

0 comments on commit b473b1b

Please sign in to comment.