Skip to content

Commit 5377dd8

Browse files
committed
Merge online and booking
1 parent c014bf1 commit 5377dd8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/BookingComponentv3.jsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,15 @@ const BookingComponent = () => {
6161
if (acceptedFIRsRegex.test(session.callsign)) {
6262
const correctedCallsign = getBookableCallsign(session.callsign, session.frequency);
6363
session.callsign = correctedCallsign;
64-
dateArray[0].data.push(session);
64+
const existingBooking = dateArray[0].data.find(booking => booking.callsign === session.callsign);
65+
if (existingBooking) {
66+
existingBooking.name = session.name;
67+
} else {
68+
dateArray[0].data.push({
69+
...session,
70+
name: session.name
71+
});
72+
}
6573
}
6674
});
6775

0 commit comments

Comments
 (0)