fix(14): remove dead generate_new branch from assignQuoteToLead (CRM-12)
assignQuoteToLead's generate_new check was unreachable since SendQuoteModal always passed false. Removes the field from both the server schema and the modal's local schema/defaultValues/call site.
This commit is contained in:
@@ -115,7 +115,6 @@ export async function logActivity(data: z.infer<typeof createActivitySchema>) {
|
||||
const assignQuoteSchema = z.object({
|
||||
lead_id: z.string().min(1),
|
||||
quote_token: z.string().optional(),
|
||||
generate_new: z.boolean(),
|
||||
});
|
||||
|
||||
export async function assignQuoteToLead(data: z.infer<typeof assignQuoteSchema>) {
|
||||
@@ -126,11 +125,6 @@ export async function assignQuoteToLead(data: z.infer<typeof assignQuoteSchema>)
|
||||
}
|
||||
|
||||
try {
|
||||
if (parsed.data.generate_new) {
|
||||
// Redirect handled on client; this is a no-op
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
// Link quote to lead and update lead status
|
||||
const token = parsed.data.quote_token;
|
||||
const leadId = parsed.data.lead_id;
|
||||
|
||||
Reference in New Issue
Block a user