rankrunners-cms 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export type SendFormFillArgs<
|
|
|
22
22
|
schema: T;
|
|
23
23
|
fieldNames: Record<string, string>;
|
|
24
24
|
data: InferInput<T>;
|
|
25
|
-
captchaToken: string;
|
|
25
|
+
captchaToken: string | null;
|
|
26
26
|
test?: boolean;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -34,6 +34,10 @@ export const sendFormFill = async <
|
|
|
34
34
|
>(
|
|
35
35
|
args: SendFormFillArgs<A, B, C, T>,
|
|
36
36
|
): Promise<SendFormFillResult> => {
|
|
37
|
+
if (!args.captchaToken) {
|
|
38
|
+
return { response: SendFormFillResultType.CaptchaError };
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
const formToSend = safeParse(args.schema, args.data);
|
|
38
42
|
|
|
39
43
|
if (!formToSend.success) {
|
|
@@ -65,7 +65,7 @@ export const formFillResultToMessage = (
|
|
|
65
65
|
): string => {
|
|
66
66
|
switch (result) {
|
|
67
67
|
case SendFormFillResultType.Success:
|
|
68
|
-
return "Form submitted successfully!";
|
|
68
|
+
return "Form submitted successfully! You will be contacted shortly by our team.";
|
|
69
69
|
case SendFormFillResultType.ValidationError:
|
|
70
70
|
return "There was a validation error with your submission. Please check your input and try again.";
|
|
71
71
|
case SendFormFillResultType.CaptchaError:
|