mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
SearchPage.duck.js: endDate should not expand end date for night
DateRangeController: unittype day should allow 0 night EditListingPage.duck.js booking state should be passed to query
This commit is contained in:
parent
47cda11c90
commit
fbd26bdfec
3 changed files with 6 additions and 4 deletions
|
|
@ -55,7 +55,7 @@ const defaultProps = {
|
|||
renderDayContents: day => {
|
||||
return <span className="renderedDay">{day.format('D')}</span>;
|
||||
},
|
||||
minimumNights: 1,
|
||||
minimumNights: config.bookingUnitType === 'line-item/night' ? 1 : 0,
|
||||
enableOutsideDays: false,
|
||||
isDayBlocked: () => false,
|
||||
|
||||
|
|
|
|||
|
|
@ -517,13 +517,13 @@ export function requestImageUpload(actionPayload) {
|
|||
}
|
||||
|
||||
export const requestFetchBookings = fetchParams => (dispatch, getState, sdk) => {
|
||||
const { listingId, start, end } = fetchParams;
|
||||
const { listingId, start, end, state } = fetchParams;
|
||||
const monthId = monthIdString(start);
|
||||
|
||||
dispatch(fetchBookingsRequest({ ...fetchParams, monthId }));
|
||||
|
||||
return sdk.bookings
|
||||
.query({ listingId, start, end }, { expand: true })
|
||||
.query({ listingId, start, end, state }, { expand: true })
|
||||
.then(response => {
|
||||
const bookings = denormalisedResponseEntities(response);
|
||||
return dispatch(fetchBookingsSuccess({ data: { monthId, bookings } }));
|
||||
|
|
|
|||
|
|
@ -136,7 +136,9 @@ export const searchListings = searchParams => (dispatch, getState, sdk) => {
|
|||
const values = datesParam ? datesParam.split(',') : [];
|
||||
const hasValues = datesParam && values.length === 2;
|
||||
const startDate = hasValues ? values[0] : null;
|
||||
const endDate = hasValues ? getExclusiveEndDate(values[1]) : null;
|
||||
const isNightlyBooking = config.bookingUnitType === 'line-item/night';
|
||||
const endDate =
|
||||
hasValues && isNightlyBooking ? values[1] : hasValues ? getExclusiveEndDate(values[1]) : null;
|
||||
|
||||
return hasValues
|
||||
? {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue