diff --git a/BE/src/main/java/com/codesquad/issuetracker/main/dao/LabelDao.java b/BE/src/main/java/com/codesquad/issuetracker/main/dao/LabelDao.java index 75d23b3..8e61299 100644 --- a/BE/src/main/java/com/codesquad/issuetracker/main/dao/LabelDao.java +++ b/BE/src/main/java/com/codesquad/issuetracker/main/dao/LabelDao.java @@ -18,17 +18,26 @@ public LabelDao(DataSource dataSource) { } public List findAttachedLabelsByIssueId(Long issueId) { - String sql = "SELECT l.id, l.name, l.hex_code " + + String sql = "SELECT l.id, l.name, l.background_color, l.color " + "FROM label l JOIN issue_has_label il ON l.id = il.label_id " + "WHERE il.issue_id = ?"; return jdbcTemplate.query(sql, new Object[]{issueId}, - (rs, rowNum) -> LabelSummary.of(rs.getInt("l.id"), rs.getString("l.name"), - rs.getString("l.hex_code"))); + (rs, rowNum) -> new LabelSummary.Builder() + .id(rs.getInt("l.id")) + .name(rs.getString("l.name")) + .backgroundColor(rs.getString("l.background_color")) + .color("l.color") + .build()); } public List