Skip to content

Commit

Permalink
Hotfix: Fix main page orderby exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
huGgW committed Sep 19, 2023
1 parent 6227d30 commit b83fd3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ class MainRepositoryImpl(
MainNoticeResponse::class.java,
noticeEntity.id,
noticeEntity.title,
noticeEntity.createdAt
)
noticeEntity.createdAt,
noticeEntity.isPinned,
),
).from(noticeEntity)
.where(noticeEntity.isDeleted.eq(false), noticeEntity.isPrivate.eq(false))
.orderBy(noticeEntity.isPinned.desc()).orderBy(noticeEntity.createdAt.desc())
Expand All @@ -70,6 +71,7 @@ class MainRepositoryImpl(
noticeTagEntity.notice.id,
noticeTagEntity.notice.title,
noticeTagEntity.notice.createdAt,
noticeEntity.isPinned,
)
).from(noticeTagEntity)
.rightJoin(noticeEntity).on(noticeTagEntity.notice.eq(noticeEntity))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package com.wafflestudio.csereal.core.main.dto

import com.querydsl.core.annotations.QueryProjection
import java.time.LocalDateTime

data class MainNoticeResponse(
val id: Long,
val title: String,
val createdAt: LocalDateTime?
) {

@QueryProjection constructor (
id: Long, title: String, createdAt: LocalDateTime?, isPinned: Boolean
): this(id, title, createdAt) {
}
}

0 comments on commit b83fd3c

Please sign in to comment.