Skip to content

Commit

Permalink
Merge pull request #172 from Hoang-Nguyen-Huy/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nguyenhcp2004 authored Nov 12, 2024
2 parents 374c09a + ec4a21d commit 2aa8799
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class RoomTypeCreationRequest {
int quantity;
int capacity;
Integer buildingId;
String image;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class RoomType {
int quantity;
int capacity;
@Column(nullable = true, length = 1000)

String image;

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class RoomTypeService {
public RoomTypeResponse createRoomType(RoomTypeCreationRequest request) {
Optional<Building> building = buildingRepository.findById(request.getBuildingId());
RoomType newRoomType = roomTypeMapper.toRoomType(request);
newRoomType.setImage(request.getImage());
newRoomType.setBuilding(building.orElse(null));
return roomTypeMapper.toRoomTypeResponse(roomTypeRepository.save(newRoomType));
}
Expand Down

0 comments on commit 2aa8799

Please sign in to comment.