diff --git a/components/groups/endpoints/create-form.tsx b/components/groups/endpoints/create-form.tsx
index 5c0ebdf..1dd2cb2 100644
--- a/components/groups/endpoints/create-form.tsx
+++ b/components/groups/endpoints/create-form.tsx
@@ -7,7 +7,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import { useFieldArray, useForm } from "react-hook-form";
-import { validationOptions } from "@/lib/validation";
+import { normalizedValidationOption, validationOptions } from "@/lib/validation";
import { createEndpointFormSchema as formSchema } from "@/lib/data/validations";
// next imports
@@ -136,7 +136,7 @@ export default function CreateForm() {
{validationOptions.map((type, index: number) => (
- {type.name}
+ {normalizedValidationOption[type.name]}
))}
diff --git a/components/groups/endpoints/edit-form.tsx b/components/groups/endpoints/edit-form.tsx
index 044afae..0847f8e 100644
--- a/components/groups/endpoints/edit-form.tsx
+++ b/components/groups/endpoints/edit-form.tsx
@@ -8,7 +8,7 @@ import * as z from "zod";
import { useFieldArray, useForm } from "react-hook-form";
import { updateEndpointFormSchema as formSchema } from "@/lib/data/validations";
-import { validationOptions } from "@/lib/validation";
+import { normalizedValidationOption, validationOptions } from "@/lib/validation";
// next imports
import { useRouter } from "next/navigation";
@@ -143,7 +143,7 @@ export default function EditForm({
{validationOptions.map((type, index: number) => (
- {type.name}
+ {normalizedValidationOption[type.name]}
))}
diff --git a/lib/validation/index.ts b/lib/validation/index.ts
index 3f110d4..73ea303 100644
--- a/lib/validation/index.ts
+++ b/lib/validation/index.ts
@@ -9,6 +9,7 @@ import validator from "validator";
* 1. add a key value pair in 'validationOptions' of the new validation type
* 2. Add a zod schema definition in the 'validations' object in this file
* 3. If necessary, add respective logic to correct / cast the type in the 'convertToCorrectTypes' function
+ * 4. Add the normalized name of the validation type in the 'normalizedValidationOption' object
*/
export const validationOptions: { name: ValidationType }[] = [
{ name: "phone" },
@@ -21,6 +22,23 @@ export const validationOptions: { name: ValidationType }[] = [
{ name: "zip_code" },
];
+/**
+ * The normalized validation types available
+ *
+ * Add a new entry to this when adding a new validation option to the 'validationOptions' array
+ */
+
+export const normalizedValidationOption = {
+ phone: "Phone Number",
+ email: "E-Mail Address",
+ string: "String",
+ number: "Number",
+ date: "Date",
+ boolean: "Boolean",
+ url: "URL",
+ zip_code: "Zip Code",
+}
+
/**
* Zod validations for each validation type
*