fix: de-duplicate constructeur ids before machine update

This commit is contained in:
Matthieu
2025-10-30 11:34:58 +01:00
parent 76cd3fac98
commit f59255e684

View File

@@ -3010,10 +3010,13 @@ const updateMachineInfo = async () => {
if (!machine.value) return
try {
const constructeurIds = uniqueConstructeurIds(machineConstructeurIds.value)
machineConstructeurIds.value = constructeurIds
const result = await updateMachineApi(machine.value.id, {
name: machineName.value,
reference: machineReference.value,
constructeurIds: machineConstructeurIds.value
constructeurIds,
})
if (result.success) {
const machinePayload = result.data?.machine && typeof result.data.machine === 'object'