fix: Dry run in prerender flow (#21876)

* fix dry run in queued flow

* All zeros uuid
This commit is contained in:
Hariom Balhara authored and GitHub committed 2025-06-17 15:53:23 +00:00
1 parent 22f136d19b
commit 1a0ce47404
3 files changed
+24 -10

No files matched your search

@@ -455,7 +455,9 @@ export const methods = {
// We now record the response to routingFormResponse and connect that with queuedResponse, as the user actually opened the modal which is confirmed by this connect method call
const newlyRecordedResponseId = await recordResponseIfQueued(params);
if (!newlyRecordedResponseId) {
// Allow 0 which is for dry run
// Negative values are not possible
if (typeof newlyRecordedResponseId !== "number") {
return;
}
await ensureRoutingFormResponseIdInUrl({
@@ -39,6 +39,10 @@ export const recordResponseIfQueued = async (params: Record<string, string | str
if (!queuedFormResponseId) {
return null;
}
// Corresponding dry run value for routingFormResponseId is 0
if (queuedFormResponseId === "00000000-0000-0000-0000-000000000000") {
return 0;
}
// form is formId and isn't acutal Form data
const { form: _1, ...actualFormData } = params;
const res = await fetch(`/api/routing-forms/queued-response`, {