diff --git a/CarWash.PWA/ClientApp/src/components/CarwashAdmin.js b/CarWash.PWA/ClientApp/src/components/CarwashAdmin.js
index eaf151db..34797761 100644
--- a/CarWash.PWA/ClientApp/src/components/CarwashAdmin.js
+++ b/CarWash.PWA/ClientApp/src/components/CarwashAdmin.js
@@ -7,10 +7,11 @@ export default class CarwashAdmin extends TrackedComponent {
displayName = 'CarwashAdmin';
render() {
- const { backlog, backlogLoading, updateBacklogItem, removeBacklogItem, invokeBacklogHub, openSnackbar, snackbarOpen } = this.props;
+ const { configuration, backlog, backlogLoading, updateBacklogItem, removeBacklogItem, invokeBacklogHub, openSnackbar, snackbarOpen } = this.props;
return (
Selected services
- {reservation.services.map(service => (
-
+ {reservation.services.map(serviceId => (
+
))}
@@ -187,6 +187,7 @@ class CarwashCard extends Component {
{
- const defaultServices = Object.values(Service);
+ const defaultServices = this.props.configuration.services.map(s => s.id);
return defaultServices.filter(s => services.filter(z => z === s).length <= 0);
};
@@ -297,7 +297,11 @@ class CarwashDetailsDialog extends React.Component {
reservation.state = State.CarKeyLeftAndLocationConfirmed;
this.props.updateReservation(reservation);
- apiFetch(`api/reservations/${this.props.reservation.id}/state/${reservation.state}`, { method: 'POST' }, true).then(
+ apiFetch(
+ `api/reservations/${this.props.reservation.id}/state/${reservation.state}`,
+ { method: 'POST' },
+ true
+ ).then(
() => {
this.props.openSnackbar('Wash canceled.');
@@ -318,7 +322,11 @@ class CarwashDetailsDialog extends React.Component {
reservation.state = State.WashInProgress;
this.props.updateReservation(reservation);
- apiFetch(`api/reservations/${this.props.reservation.id}/state/${reservation.state}`, { method: 'POST' }, true).then(
+ apiFetch(
+ `api/reservations/${this.props.reservation.id}/state/${reservation.state}`,
+ { method: 'POST' },
+ true
+ ).then(
() => {
this.props.openSnackbar('Wash in progress.');
@@ -451,11 +459,17 @@ class CarwashDetailsDialog extends React.Component {
}
// cannot have both AC cleaning
- if (service === Service.AcCleaningBomba && reservation.services.filter(s => s === Service.AcCleaningOzon).length > 0) {
+ if (
+ service === Service.AcCleaningBomba &&
+ reservation.services.filter(s => s === Service.AcCleaningOzon).length > 0
+ ) {
const serviceToRemove = reservation.services.indexOf(Service.AcCleaningOzon);
if (serviceToRemove !== -1) reservation.services.splice(serviceToRemove, 1);
}
- if (service === Service.AcCleaningOzon && reservation.services.filter(s => s === Service.AcCleaningBomba).length > 0) {
+ if (
+ service === Service.AcCleaningOzon &&
+ reservation.services.filter(s => s === Service.AcCleaningBomba).length > 0
+ ) {
const serviceToRemove = reservation.services.indexOf(Service.AcCleaningBomba);
if (serviceToRemove !== -1) reservation.services.splice(serviceToRemove, 1);
}
@@ -593,7 +607,7 @@ class CarwashDetailsDialog extends React.Component {
render() {
const { editLocation, garage, floor, seat, validationErrors, editServices } = this.state;
- const { reservation, open, snackbarOpen, classes } = this.props;
+ const { reservation, configuration, open, snackbarOpen, classes } = this.props;
return (
@@ -612,8 +626,8 @@ class CarwashDetailsDialog extends React.Component {