fix(projects): scope 'book to project' to the current customer

A project has at most one customer, so the hours picker shouldn't offer
other customers' projects. HoursSection now passes customerAccountId to
ProjectSelect (shows this customer's projects + still-unassigned ones).
Backend createEntry rejects a projectId owned by a different customer
(422 PROJECT_CUSTOMER_MISMATCH) as defence-in-depth behind the picker.
This commit is contained in:
Luca
2026-06-07 00:58:44 +02:00
parent 0cc52f3693
commit 89bfb6c519
2 changed files with 14 additions and 2 deletions
@@ -358,6 +358,7 @@ export const HoursSection: React.FC<HoursSectionProps> = ({
className="mt-3"
label={t('customers.hours.form.bookToProject', 'Book to project') as string}
value={projectId}
customerAccountId={customerId}
onChange={setProjectId}
/>
<div className="mt-3 flex items-center justify-end gap-3">