From f9641dbd624e808392370b0a8f325b69fa5f6a05 Mon Sep 17 00:00:00 2001 From: MatthieuTD <39524319+MatthieuTD@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:19:30 +0200 Subject: [PATCH] Restore catalogs and type-aware machine selection --- app/composables/usePieces.js | 6 +- app/pages/machine/[id].vue | 85 +++++- app/pages/machines/new.vue | 105 ++++++- app/pages/pieces-catalog.vue | 513 +++++++++++++++++++++++++++++++++-- 4 files changed, 683 insertions(+), 26 deletions(-) diff --git a/app/composables/usePieces.js b/app/composables/usePieces.js index 4042e2c..f3e1340 100644 --- a/app/composables/usePieces.js +++ b/app/composables/usePieces.js @@ -62,7 +62,11 @@ export function usePieces () { const result = await post('/pieces', pieceData) if (result.success) { pieces.value.push(result.data) - showSuccess(`Pièce "${pieceData.name}" créée avec succès`) + const displayName = result.data?.name + || pieceData?.definition?.name + || pieceData?.name + || 'Pièce' + showSuccess(`Pièce "${displayName}" créée avec succès`) } return result } catch (error) { diff --git a/app/pages/machine/[id].vue b/app/pages/machine/[id].vue index 4bb43a0..a62c26b 100644 --- a/app/pages/machine/[id].vue +++ b/app/pages/machine/[id].vue @@ -563,6 +563,27 @@
+
+ + +
+
+ + +
+
+ + +
+
+ + +