added backup and email client
This commit is contained in:
@@ -142,6 +142,17 @@ export default function ContractForm() {
|
||||
}
|
||||
}, [isEdit]);
|
||||
|
||||
// Set preselected customer from URL params (for new contracts)
|
||||
useEffect(() => {
|
||||
if (!isEdit && preselectedCustomerId && customersData?.data) {
|
||||
// Only set if the customer exists in the list
|
||||
const customerExists = customersData.data.some(c => c.id.toString() === preselectedCustomerId);
|
||||
if (customerExists) {
|
||||
setValue('customerId', preselectedCustomerId);
|
||||
}
|
||||
}
|
||||
}, [isEdit, preselectedCustomerId, customersData, setValue]);
|
||||
|
||||
// Reset tariffId when providerId changes (but only after initial contract load)
|
||||
useEffect(() => {
|
||||
// Only reset tariff if:
|
||||
|
||||
Reference in New Issue
Block a user