Skip to content

Commit

Permalink
hotfix: request info 500 에러 수정, 프로젝트 리스트에 설명 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kmer1024 committed Dec 11, 2024
1 parent 0ea0ec4 commit 140a303
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@Builder
public record ProjectListEntity(
String name,
Long projectId
Long projectId,
String description
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ WHERE p.id IN (
List<Schedule> findSchedulesByCurrentMonthAndProjectId(Long projectId);


@Query("SELECT pp.project.name, pp.project.id FROM ProjectParticipate pp WHERE pp.user.id = :userId")
@Query("SELECT pp.project.name, pp.project.id, pp.project.description FROM ProjectParticipate pp WHERE pp.user.id = :userId")
List<Object[]> findProjectNamesByUserId(@Param("userId") Long userId);

@Query( """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public ProjectListResponse getProjectListsByUserId(Long userId) {
List<ProjectListEntity> projects = projectListEntities.stream()
.map(result -> new ProjectListEntity(
(String) result[0], // 이름
(Long) result[1] // ID
(Long) result[1],
(String) result[2]
))
.collect(Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public RequestInfoResponse getRequestInfo(Long requestId, Long userId) {
String senderName = (String) result[5];
String receiverNames = (String) result[6];
String scheduleName = (String) result[7]; // 일정 이름

List<String> receivers = Arrays.asList(receiverNames.split(","));
List<String> receivers = new ArrayList<>();
if (receiverNames != null) {
receivers = Arrays.asList(receiverNames.split(","));
}
Long id = (Long)result[8];
Boolean isSender = false;
if (tempUser.getName().equals(senderName)) {
Expand Down

0 comments on commit 140a303

Please sign in to comment.