Skip to content

Commit 8b880e0

Browse files
committed
feat: adding user avatars in get days off endpoint
1 parent 84e28f4 commit 8b880e0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/app/teamwize/api/dayoff/repository/DayOffRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
@Repository
1515
public interface DayOffRepository extends BaseJpaRepository<DayOff, Long>, JpaSpecificationExecutor<DayOff> {
1616

17-
@EntityGraph(attributePaths = {"user", "user.team"}, type = EntityGraph.EntityGraphType.FETCH)
17+
@EntityGraph(attributePaths = {"user", "user.team", "user.avatar"}, type = EntityGraph.EntityGraphType.FETCH)
1818
Optional<DayOff> findByUserIdAndId(Long userId, Long id);
1919

2020

21-
@EntityGraph(attributePaths = {"user", "user.team"}, type = EntityGraph.EntityGraphType.FETCH)
21+
@EntityGraph(attributePaths = {"user", "user.team", "user.avatar"}, type = EntityGraph.EntityGraphType.FETCH)
2222
Page<DayOff> findByOrganizationIdAndUserId(Long organizationId, Long userId, Pageable page);
2323

2424

25-
@EntityGraph(attributePaths = {"user", "user.team"}, type = EntityGraph.EntityGraphType.FETCH)
25+
@EntityGraph(attributePaths = {"user", "user.team", "user.avatar"}, type = EntityGraph.EntityGraphType.FETCH)
2626
Page<DayOff> findAll(Specification<DayOff> spec, Pageable pageable);
2727
}

src/main/java/app/teamwize/api/user/domain/response/UserCompactResponse.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package app.teamwize.api.user.domain.response;
22

3+
import app.teamwize.api.assets.domain.model.response.AssetCompactResponse;
34
import app.teamwize.api.team.domain.response.TeamCompactResponse;
45
import app.teamwize.api.user.domain.UserRole;
56
import app.teamwize.api.user.domain.UserStatus;
@@ -26,5 +27,7 @@ public record UserCompactResponse(
2627
@Nullable
2728
String timezone,
2829
@Nonnull
29-
TeamCompactResponse team) {
30+
TeamCompactResponse team,
31+
@Nonnull
32+
AssetCompactResponse avatar) {
3033
}

0 commit comments

Comments
 (0)