nss-evening-cohort-10/nutshell-michelin-restaurant

Bug - make sure add and update functions create the correct object structure

Opened this issue · 2 comments

Currently adding a reservation results in an error message of
reservations.js?e62e:144 Uncaught (in promise) TypeError: Cannot read property 'numOfSeats' of undefined at eval (reservations.js?e62e:144)

likely due to the reservation creation/update flow no longer matching the data structure of the seed data.

seed data json for reservations is currently structured as:
{
"reservation1": {
"seatingId": "",
"partySize": #,
"customerName": "",
"timeStamp": "0000-00-00 00:00",
"sectionId": ""
},

the function passing through addReservationByClick needs to create the order to reflect this new structure and define the value for "numOfSeats"

update function still works and doesn't yield error. only add returns this error message.

and with newest master, the error message has changed to

reservations.js?e62e:49 TypeError: Cannot read property 'sectionId' of null at eval (reservations.js?e62e:35)