refactor: new order typings

This commit is contained in:
2025-09-29 14:14:07 +02:00
parent 98fda8e849
commit 7784e08f03
5 changed files with 60 additions and 15 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue';
import { useStore } from '../store/store';
import { LocalStorageOrder } from '../types/orderTypes';
import { LocalStorageOrderLegacy } from '../types/orderTypes';
function alertWrongOrderFormat() {
alert('Wystąpił błąd podczas przetwarzania rozkazu! Informacje mogą być niepoprawne!');
@@ -15,14 +15,14 @@ export default defineComponent({
},
methods: {
removeLocalOrder(order: LocalStorageOrder) {
removeLocalOrder(order: LocalStorageOrderLegacy) {
localStorage.removeItem(order.id);
if (this.store.chosenLocalOrderId == order.id) this.store.chosenLocalOrderId = '';
// localStorage.setItem('orderCount', (Number(localStorage.getItem('orderCount')) - 1).toString());
},
selectLocalOrder(localOrder: LocalStorageOrder) {
selectLocalOrder(localOrder: LocalStorageOrderLegacy) {
// const localOrder = JSON.parse(JSON.stringify(order));
const { orderBody: localOrderBody, orderFooter: localOrderFooter } = localOrder;