fix update package detail to merge

This commit is contained in:
ItsMalma
2025-12-18 15:25:31 +07:00
parent e1a1b780d0
commit 85d9fb3086

View File

@@ -1303,7 +1303,8 @@ export class PackageController extends Controller {
}); });
} }
wrap(packageDetail).assign({ wrap(packageDetail).assign(
{
departureDate: body.departure_date, departureDate: body.departure_date,
tourFlight: tourFlightSchedule, tourFlight: tourFlightSchedule,
outboundFlight: outboundFlightSchedule, outboundFlight: outboundFlightSchedule,
@@ -1331,7 +1332,12 @@ export class PackageController extends Controller {
infantDiscount: body.infant_discount, infantDiscount: body.infant_discount,
itinerary: itineraryEntity, itinerary: itineraryEntity,
updatedAt: new Date(), updatedAt: new Date(),
}); },
{
mergeObjectProperties: true,
updateByPrimaryKey: false,
},
);
packageDetail.tourHotels.set([]); packageDetail.tourHotels.set([]);
for (const [index, tourHotel] of (body.tour_hotels ?? []).entries()) { for (const [index, tourHotel] of (body.tour_hotels ?? []).entries()) {