Fix contact form action processing for "reset" being nested incorrectly

This commit is contained in:
badblocks 2026-07-02 11:48:35 -07:00
parent e010ac2fd7
commit 6e7977997e
Signed by: badblocks
SSH key fingerprint: SHA256:hEcM6BP4hKm9F7WsomNuXSBpPn2BSDnFzPSl3y1NerQ

View file

@ -167,6 +167,12 @@ const submitActionDefinition = {
return { return {
nextAction: "complete", nextAction: "complete",
}; };
}
throw new ActionError({
code: "SERVICE_UNAVAILABLE",
message: "Message failed to send.",
});
} else if (input.action === "reset") { } else if (input.action === "reset") {
context.session?.delete("phone"); context.session?.delete("phone");
context.session?.delete("name"); context.session?.delete("name");
@ -176,12 +182,6 @@ const submitActionDefinition = {
nextAction: "send_otp", nextAction: "send_otp",
}; };
} }
throw new ActionError({
code: "SERVICE_UNAVAILABLE",
message: "Message failed to send.",
});
}
}, },
}; };