diff --git a/plugins/computers/frontend/views/PCForm.vue b/plugins/computers/frontend/views/PCForm.vue index ab141dcc..2278f3ab 100644 --- a/plugins/computers/frontend/views/PCForm.vue +++ b/plugins/computers/frontend/views/PCForm.vue @@ -573,12 +573,14 @@ onMounted(async () => { operatingsystemsApi.list({ perpage: 100 }), computersApi.protocols.list(), businessunitsApi.listAll(), - // Handles its own failure: a site without printers still gets a form. ]) pcTypes.value = ptRes.data.data || [] statuses.value = statusRes.data.data || [] - vendors.value = vendorRes.data.data || [] + // listAll() pages past the server's 100-row cap and returns the ROWS, not + // an axios response, so these are read directly. Reading .data.data here + // throws and takes the whole form down with it. + vendors.value = vendorRes || [] models.value = allModels locations.value = locRes || [] operatingsystems.value = osRes.data.data || [] @@ -636,7 +638,11 @@ onMounted(async () => { } } catch (err) { console.error('Error loading data:', err) - error.value = 'Failed to load data' + // A client-side TypeError has no err.response, so apiError() would report + // only the fallback and hide which field broke. Name it either way. + error.value = err?.response + ? apiError(err, 'Failed to load data') + : `Failed to load data: ${err?.message || err}` } finally { loading.value = false } diff --git a/plugins/machines/frontend/views/MachineForm.vue b/plugins/machines/frontend/views/MachineForm.vue index bce1693a..f7b21a89 100644 --- a/plugins/machines/frontend/views/MachineForm.vue +++ b/plugins/machines/frontend/views/MachineForm.vue @@ -591,14 +591,14 @@ onMounted(async () => { machineTypes.value = typesRes.data.data || [] statuses.value = statusRes.data.data || [] - vendors.value = vendorRes.data.data || [] - locations.value = locRes || [] - models.value = allModels - businessunits.value = buRes.data.data || [] // listAll resolves to the ARRAY, not a response: fetchAllPages already // unwrapped every page. Reading .data.data off it threw, and the whole // parallel load went to the catch - so every dropdown on this form came up // empty and the machine's own values never loaded. + vendors.value = vendorRes || [] + locations.value = locRes || [] + models.value = allModels + businessunits.value = buRes || [] pcs.value = pcsRes || [] // Load relationship types separately diff --git a/plugins/measuringtools/frontend/views/MeasuringToolForm.vue b/plugins/measuringtools/frontend/views/MeasuringToolForm.vue index 5b18eb76..2ca95eec 100644 --- a/plugins/measuringtools/frontend/views/MeasuringToolForm.vue +++ b/plugins/measuringtools/frontend/views/MeasuringToolForm.vue @@ -187,8 +187,11 @@ onMounted(async () => { ]) types.value = typesResponse.data.data || [] statuses.value = statusResponse.data.data || [] + // listAll resolves to the ARRAY, not a response: fetchAllPages already + // unwrapped every page. Reading .data.data off it throws and takes the + // whole parallel load into the catch. locations.value = locResponse || [] - businessunits.value = buResponse.data.data || [] + businessunits.value = buResponse || [] const assetType = (assetTypesResponse.data.data || []).find(a => a.assettype === 'measuring_tool') assettypeid.value = assetType ? assetType.assettypeid : null