fix(14-03): remove dead onSubmit branch in SendQuoteModal (CRM-12)

- Remove unreachable if (tab === "new") branch in onSubmit - the new-tab button has its own onClick navigation and never triggers form submit
- Escape unescaped double quotes in JSX text (react/no-unescaped-entities)
- generate_new field left as-is per plan (optional cleanup, out of scope)
- Log pre-existing useForm<any>/onSubmit(data: any) no-explicit-any lint errors to deferred-items.md (out of scope: fixing requires resolving a zodResolver/Resolver generic incompatibility with assignQuoteSchema's optional/default fields)
This commit is contained in:
2026-06-14 12:46:55 +02:00
parent ee509cd5fb
commit a495d84511
2 changed files with 10 additions and 7 deletions
@@ -48,12 +48,6 @@ export function SendQuoteModal({ leadId }: { leadId: string }) {
async function onSubmit(data: any) {
setLoading(true);
try {
if (tab === "new") {
// Redirect to quote builder pre-filled with this lead
window.location.href = `/admin/quotes/new?lead_id=${leadId}`;
return;
}
const result = await assignQuoteToLead({
lead_id: leadId,
quote_token: data.quote_token,
@@ -109,7 +103,7 @@ export function SendQuoteModal({ leadId }: { leadId: string }) {
/>
<p className="text-xs text-gray-600">
Copia il token dal preventivo e incollalo qui. Il lead sarà aggiornato a
"Proposal Sent".
&quot;Proposal Sent&quot;.
</p>
<Button type="submit" disabled={loading} className="w-full">
{loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}