feat: add regex validation for funnel steps and improve error handling in CreateFunnelPage

This commit is contained in:
Usman Baig
2026-02-04 23:48:06 +01:00
parent c37c66cbf3
commit 002fe50d9a
2 changed files with 15 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ export async function deleteFunnel(siteId: string, funnelId: string): Promise<vo
const DATE_ONLY_REGEX = /^\d{4}-\d{2}-\d{2}$/
/** Normalize date-only (YYYY-MM-DD) to RFC3339 for backend funnel stats API. */
/** Normalize date-only (YYYY-MM-DD) to RFC3339 for backend funnel stats API. Uses UTC for boundaries (API/server timestamps are UTC). */
function toRFC3339Range(from: string, to: string): { from: string; to: string } {
return {
from: DATE_ONLY_REGEX.test(from) ? `${from}T00:00:00.000Z` : from,