diff --git a/web/admin/src/pages/orders/AdminOrderPage.vue b/web/admin/src/pages/orders/AdminOrderPage.vue index 333c195..ec1d247 100644 --- a/web/admin/src/pages/orders/AdminOrderPage.vue +++ b/web/admin/src/pages/orders/AdminOrderPage.vue @@ -60,18 +60,6 @@ const resetShowMessages = () => { errMessage.value = 'An error occurred' } -const deleteItem = async() => { - resetShowMessages() - try { - await deleteDoc(doc(db, 'order', props.id)) - showDeleteMessage.value = true - router.push({name: 'OrdersListPage'}) - } catch(err) { - showErrMessage.value = true - console.error(err) - } -} - const saveItem = async () => { resetShowMessages() try { @@ -82,21 +70,6 @@ const saveItem = async () => { showSaveMessage.value = true } else { - const q = query(collection(db, 'order'), where('name', '==', item.value.guestname)) - const docs = await getDocs(q) - if (docs.size > 0) { - errMessage.value = 'Order with guestname ' + item.value.guestname + ' already exists' - showErrMessage = true - return - } - - console.log('saveItem currentForm, enddate', currentForm.value, currentForm.value.enddate) - if (currentForm.value && currentForm.value.enddate) { - item.value.enddate = currentForm.value.enddate - } - - const itemRef = await addDoc(collection(db, 'order'), item.value) - router.push({name: 'OrdersListPage'}) } } catch(err) { @@ -156,8 +129,8 @@ onBeforeMount(async() => {
Number in Household: {{ item.numInHousehold }}
-