From 28ea42ef2758f69b829be94ba5a288dfa34ce3a0 Mon Sep 17 00:00:00 2001 From: bri Date: Sun, 25 Oct 2020 16:01:04 -1000 Subject: [PATCH 1/4] adds clear reservations button --- src/components/WaitList/WaitList.jsx | 34 ++++++++++++++++++++++++- src/views/RetailerView/RetailerView.jsx | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/components/WaitList/WaitList.jsx b/src/components/WaitList/WaitList.jsx index 382474a..9bf34ae 100644 --- a/src/components/WaitList/WaitList.jsx +++ b/src/components/WaitList/WaitList.jsx @@ -2,14 +2,31 @@ import React from 'react'; import styles from './WaitList.module.scss' import clock from '../../utils/imgs/clock.png' import Reservation from '../Reservation'; +import { actionUpdateReservation } from '../../actions'; +import { connect } from "react-redux"; const WaitList = (props) => { let { retailerName, waitList, + holdList, handlePlusPartySize, } = props; + const clearReservations = () => { + if (waitList.length === 0 && holdList.length === 0) { + return alert('no reservations to cancel') + }; + waitList.map((res) => { + let data = { queueStatus: 'cancelled' } + return props.dispatchUpdateReservation(data, res.id) + }); + holdList.map((res) => { + let data = { queueStatus: 'cancelled' } + return props.dispatchUpdateReservation(data, res.id) + }) + }; + return (