From d6750c015f758abf3dd112f7b358974cadc2f8c9 Mon Sep 17 00:00:00 2001 From: szewczyw Date: Mon, 7 Apr 2025 17:27:09 +0200 Subject: [PATCH] upgraded cancelation process --- src/components/CancelationModal.vue | 22 ++++---- src/components/ConfirmedForm.vue | 84 +++++++++++++---------------- src/components/NavBar.vue | 2 +- src/components/SummaryComponent.vue | 2 +- src/stores/categories.store.ts | 3 +- src/stores/siteControl.store.ts | 4 +- src/views/LoginView.vue | 2 +- 7 files changed, 55 insertions(+), 64 deletions(-) diff --git a/src/components/CancelationModal.vue b/src/components/CancelationModal.vue index 151040c..d72be05 100644 --- a/src/components/CancelationModal.vue +++ b/src/components/CancelationModal.vue @@ -14,13 +14,17 @@ const categoriesStore = useCategoriesStore(); const { uuid } = storeToRefs(ordersStore); const { showCancellationModal, isLoading } = storeToRefs(siteControlStore); -const cancellationReason = ref(); +const cancellationReason = ref(""); async function cancelOrder() { showCancellationModal.value = false; // console.log(cancellationReason.value); - axiosInstance.delete('/zamowienie/' + uuid.value); - siteControlStore.newOrder(true); + axiosInstance.delete('/zamowienie/' + uuid.value, { + data: { + MZN_AnulowanePowod: cancellationReason.value + } + }); + siteControlStore.newOrder("/orders"); } @@ -35,17 +39,15 @@ async function cancelOrder() {
+
- +
diff --git a/src/components/ConfirmedForm.vue b/src/components/ConfirmedForm.vue index 5ee8938..e204169 100644 --- a/src/components/ConfirmedForm.vue +++ b/src/components/ConfirmedForm.vue @@ -4,7 +4,6 @@ import { useOrdersStore } from '@/stores/orders.store' import { storeToRefs } from 'pinia' import { useCategoriesStore } from '@/stores/categories.store' import { useContractorsStore } from '@/stores/contractors.store' -import { axiosInstance } from '@/main' import { useRoutesStore } from '@/stores/routes.store' import { useSiteControlStore } from '@/stores/siteControl.store' @@ -32,19 +31,19 @@ function cancelOrder(event: Event) { \ No newline at end of file + + \ No newline at end of file diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 697102c..8282942 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -80,7 +80,7 @@ function routeLogin() {