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

2 stars 4 forks source link

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

Open kelsey-21 opened 4 years ago

kelsey-21 commented 4 years ago

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.

jacob-bw commented 4 years ago

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"

jacob-bw commented 4 years ago

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)