File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ export interface RoomAvailabilityListDTO {
4040}
4141
4242export interface CreateRoomAvailabilityItemDTO {
43+ /**
44+ * ID of the existing room availability item.
45+ * If 0, then this is a brand new one
46+ */
47+ existingId : number ,
4348 /**
4449 * Date object
4550 */
Original file line number Diff line number Diff line change @@ -105,9 +105,23 @@ const startEditingRoomAvailability = () => {
105105}
106106
107107const submitEditingRoomAvailability = () => {
108+ var items: CreateRoomAvailabilityItemDTO [] = [];
109+ for (let index = 0 ; index < roomAvailability .value .items .length ; index ++ ) {
110+ const element = roomAvailability .value .items [index ];
111+
112+ const item: CreateRoomAvailabilityItemDTO = {
113+ existingId: element .id ,
114+ dateFrom: element .dateFrom ,
115+ dateTo: element .dateTo ,
116+ available: element .available
117+ }
118+
119+ items .push (item );
120+ }
121+
108122 const createRoomAvailability: CreateRoomAvailabilityListDTO = {
109123 roomId: roomAvailability .value .roomId ,
110- items: roomAvailability . value . items
124+ items
111125 };
112126
113127 errorAvailability .value = " " ;
You can’t perform that action at this time.
0 commit comments