Attach room type code and tags to room images
All checks were successful
build-and-deploy / build-deploy (push) Successful in 31s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 31s
This commit is contained in:
@@ -59,7 +59,8 @@ class RoomImages(
|
||||
@AuthenticationPrincipal principal: MyPrincipal?,
|
||||
@RequestParam("file") file: MultipartFile,
|
||||
@RequestParam(required = false) sortOrder: Int?,
|
||||
@RequestParam(required = false) category: String?
|
||||
@RequestParam(required = false) category: String?,
|
||||
@RequestParam(required = false) tags: List<String>?
|
||||
): RoomImageResponse {
|
||||
requirePrincipal(principal)
|
||||
propertyAccess.requireMember(propertyId, principal!!.userId)
|
||||
@@ -82,6 +83,8 @@ class RoomImages(
|
||||
thumbnailPath = stored.thumbnailPath,
|
||||
contentType = stored.contentType,
|
||||
sizeBytes = stored.sizeBytes,
|
||||
roomTypeCode = room.roomType.code,
|
||||
tags = tags?.toMutableSet() ?: mutableSetOf(),
|
||||
sortOrder = sortOrder,
|
||||
category = category
|
||||
)
|
||||
@@ -134,10 +137,12 @@ private fun RoomImage.toResponse(baseUrl: String): RoomImageResponse {
|
||||
id = id,
|
||||
propertyId = property.id!!,
|
||||
roomId = room.id!!,
|
||||
roomTypeCode = roomTypeCode,
|
||||
url = "$baseUrl/properties/${property.id}/rooms/${room.id}/images/$id/file",
|
||||
thumbnailUrl = "$baseUrl/properties/${property.id}/rooms/${room.id}/images/$id/file?size=thumb",
|
||||
contentType = contentType,
|
||||
sizeBytes = sizeBytes,
|
||||
tags = tags.toSet(),
|
||||
sortOrder = sortOrder,
|
||||
category = category,
|
||||
createdAt = createdAt.toString()
|
||||
|
||||
Reference in New Issue
Block a user