From c393d8e6a136a20011c72b3e4ef2871beae7de6c Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Wed, 13 Nov 2024 18:16:11 +0100 Subject: [PATCH] - Disabled default Car being ID:2 - Showing Message if User has no default car --- .../WarehouseShippingNote/WarehouseShippingNoteController.php | 2 +- .../pages/WarehouseShippingNote/WarehouseShippingNoteModal.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/application/WarehouseShippingNote/WarehouseShippingNoteController.php b/application/WarehouseShippingNote/WarehouseShippingNoteController.php index 9f3f390b4..e8181f742 100644 --- a/application/WarehouseShippingNote/WarehouseShippingNoteController.php +++ b/application/WarehouseShippingNote/WarehouseShippingNoteController.php @@ -384,7 +384,7 @@ class WarehouseShippingNoteController extends TTCrud { die(json_encode(['success' => true, 'id' => $timerecordingCar->id])); } } - die(json_encode(['success' => true, 'id' => 2])); + die(json_encode(['success' => true, 'status' => 'USER_NO_CAR'])); } diff --git a/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js b/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js index 4df50e00f..47813c404 100644 --- a/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js +++ b/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js @@ -97,6 +97,10 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', { }, async updateCarId() { const response = await axios.get(window.TT_CONFIG["BASE_PATH"] + '/WarehouseShippingNote/timerecordingCarForUser?userId=' + this.userId); + if (response.data.status === 'USER_NO_CAR') { + this.window.notify('info', 'Kein zugewiesenes Fahrzeug gefunden'); + return; + } this.carId = response.data.id; }, updateDate() {