Skip to content

Commit

Permalink
fix: 스페이스 정렬 순서 변경하기 (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondanythings authored Aug 15, 2024
1 parent 1ffee21 commit 58fd914
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.layer.domain.space.entity.SpaceField;
import org.layer.domain.space.exception.SpaceException;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

Expand Down Expand Up @@ -48,7 +49,10 @@ public record SpaceWithMemberCountInfo(
Long memberCount,

@Schema(description = "스페이스 배너 이미지")
String bannerUrl
String bannerUrl,

@Schema(description = "스페이스 생성 일자")
LocalDateTime createdAt
) {
public static SpaceWithMemberCountInfo toResponse(SpaceWithMemberCount space) {
return Optional.ofNullable(space)
Expand All @@ -61,7 +65,9 @@ public static SpaceWithMemberCountInfo toResponse(SpaceWithMemberCount space) {
.formId(it.getFormId())
.memberCount(it.getMemberCount())
.bannerUrl(it.getBannerUrl())
.build())
.createdAt(it.getCreatedAt())
.build()
)
.orElseThrow(() -> new BaseCustomException(INVALID_REFRESH_TOKEN));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public List<SpaceWithMemberCount> findAllSpacesByMemberIdAndCategoryAndCursor(Lo
return getSpaceWithMemberCountQuery()
.where(predicate)
.groupBy(space.id)
.orderBy(space.id.asc())
.orderBy(space.createdAt.desc())
.limit(pageSize + 1)
.fetch();
}
Expand Down

0 comments on commit 58fd914

Please sign in to comment.