Auto-assign room image order on upload
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 27s
This commit is contained in:
@@ -17,4 +17,10 @@ interface RoomImageRepo : JpaRepository<RoomImage, UUID> {
|
||||
)
|
||||
fun findByRoomIdOrdered(@Param("roomId") roomId: UUID): List<RoomImage>
|
||||
fun findByIdAndRoomIdAndPropertyId(id: UUID, roomId: UUID, propertyId: UUID): RoomImage?
|
||||
|
||||
@Query("select coalesce(max(ri.roomSortOrder), 0) from RoomImage ri where ri.room.id = :roomId")
|
||||
fun findMaxRoomSortOrder(@Param("roomId") roomId: UUID): Int
|
||||
|
||||
@Query("select coalesce(max(ri.roomTypeSortOrder), 0) from RoomImage ri where ri.roomTypeCode = :roomTypeCode")
|
||||
fun findMaxRoomTypeSortOrder(@Param("roomTypeCode") roomTypeCode: String): Int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user