fix(documents): preserve edited line-item description (#658)

The per-line item description typed into the row's textarea was never
saved. BaseItemSelect's description field pushes edits out only via an
`update:description` emit, but DocumentItemRow (the single shared row used
by invoices, estimates, and recurring invoices) wired only `@search` and
`@select` — so the emit was dropped and `form.items[index].description`
never updated. On submit the field was lost; a catalog item's description
also reverted on the next re-render.

Capture the event and route it through the existing `updateItemAttribute`
store updater, mirroring how name/quantity/price/discount already sync.
One fix covers all three document types since they share the row.

Also add the missing `items.*.description` nullable rule to
RecurringInvoiceRequest for parity with the invoice/estimate requests.

The backend already persisted and returned description correctly; this was
purely a dropped frontend event.
This commit is contained in:
Darko Gjorgjijoski
2026-06-12 11:27:56 +02:00
committed by GitHub
parent f007daa65b
commit e41ee8083d
2 changed files with 4 additions and 0 deletions

View File

@@ -83,6 +83,9 @@ class RecurringInvoiceRequest extends FormRequest
'items.*' => [
'required',
],
'items.*.description' => [
'nullable',
],
];
$customer = Customer::find($this->customer_id);

View File

@@ -33,6 +33,7 @@
:store="store"
@search="searchVal"
@select="onSelectItem"
@update:description="updateItemAttribute('description', $event)"
/>
</div>
</td>