fix: add arg validation to ensureValidPhoneNumber (#21259)

This commit is contained in:
Benny Joo authored and GitHub committed 2025-05-13 18:57:00 -07:00
1 parent 3bc9fa11d0
commit 9a671f9063
1 file changed
+1
@@ -17,6 +17,7 @@ export const bookingResponsesDbSchema = z.record(dbReadResponseSchema);
const catchAllSchema = bookingResponsesDbSchema;
const ensureValidPhoneNumber = (value: string) => {
if (!value) return "";
// + in URL could be replaced with space, so we need to replace it back
// Replace the space(s) in the beginning with + as it is supposed to be provided in the beginning only
return value.replace(/^ +/, "+");