From 51ce591d4d7b14ecb847826f94c5562d66d8f29f Mon Sep 17 00:00:00 2001 From: Lina Ebeid Date: Wed, 26 Aug 2020 09:20:33 +0300 Subject: [PATCH] add bookingTYpeID when readOnly --- client/src/components/DayView/Calendar.js | 4 +++- client/src/components/Form/Reservation/index.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/components/DayView/Calendar.js b/client/src/components/DayView/Calendar.js index a75b2f8..9b003fa 100644 --- a/client/src/components/DayView/Calendar.js +++ b/client/src/components/DayView/Calendar.js @@ -85,6 +85,7 @@ class Calendar extends React.Component { userName: event.name, color: event.color, noOfPeople: event.noofpeople, + typeID: event.bookingtype_id, })), }); }) @@ -98,7 +99,7 @@ class Calendar extends React.Component { start, end, title, - extendedProps: { description, userName, userid, noOfPeople }, + extendedProps: { description, userName, userid, noOfPeople, typeID }, } = event; this.setState({ modalData: { @@ -112,6 +113,7 @@ class Calendar extends React.Component { userid, readOnly: true, noOfPeople, + typeID, }, }); this.showModal(); diff --git a/client/src/components/Form/Reservation/index.js b/client/src/components/Form/Reservation/index.js index d2ce8d7..734872a 100644 --- a/client/src/components/Form/Reservation/index.js +++ b/client/src/components/Form/Reservation/index.js @@ -53,6 +53,7 @@ class BookingForm extends React.Component { description, readOnly, noOfPeople, + typeID, } = modalData; const disabled = confirmLoading || readOnly; const { admin, userID } = this.context; @@ -90,6 +91,7 @@ class BookingForm extends React.Component { repeat: 'once', remind: true, noOfPeople, + bookingTypeId: typeID, }} ref={this.formRef} onFinish={(values) => { @@ -147,7 +149,7 @@ class BookingForm extends React.Component { label="Booking Type" rules={[{ required: true, message: 'Choose booking type' }]} > - {types.map((type) => ( {type.category} @@ -255,6 +257,7 @@ BookingForm.propTypes = { title: PropTypes.string, description: PropTypes.string, userName: PropTypes.string, + typeID: PropTypes.string, userid: PropTypes.number, readOnly: PropTypes.bool, noOfPeople: PropTypes.number,