fix: de-duplicate constructeur ids before machine update
This commit is contained in:
@@ -3010,10 +3010,13 @@ const updateMachineInfo = async () => {
|
|||||||
if (!machine.value) return
|
if (!machine.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const constructeurIds = uniqueConstructeurIds(machineConstructeurIds.value)
|
||||||
|
machineConstructeurIds.value = constructeurIds
|
||||||
|
|
||||||
const result = await updateMachineApi(machine.value.id, {
|
const result = await updateMachineApi(machine.value.id, {
|
||||||
name: machineName.value,
|
name: machineName.value,
|
||||||
reference: machineReference.value,
|
reference: machineReference.value,
|
||||||
constructeurIds: machineConstructeurIds.value
|
constructeurIds,
|
||||||
})
|
})
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const machinePayload = result.data?.machine && typeof result.data.machine === 'object'
|
const machinePayload = result.data?.machine && typeof result.data.machine === 'object'
|
||||||
|
|||||||
Reference in New Issue
Block a user