Fix quantity sent as string when saving an asset

submitAssetForm() converted item_type_id/folder_id/status_id/
assigned_user_id from FormData's string values to numbers before
JSON-encoding the payload, but missed quantity, so it stayed a string
and the server's json.Decode into assetRequest.Quantity (int) rejected
it as "cannot unmarshal string into Go struct field".
This commit is contained in:
Owen
2026-08-17 17:00:08 -05:00
parent e86ffe765c
commit 4e4313723e
+2
View File
@@ -713,6 +713,8 @@
payload.status_id = Number(value); payload.status_id = Number(value);
} else if (key === 'assigned_user_id') { } else if (key === 'assigned_user_id') {
payload.assigned_user_id = value ? Number(value) : null; payload.assigned_user_id = value ? Number(value) : null;
} else if (key === 'quantity') {
payload.quantity = Number(value) || 0;
} else { } else {
payload[key] = value; payload[key] = value;
} }