diff --git a/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx b/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx index 08ff79d45e..cb05cce6c7 100644 --- a/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx +++ b/app/client/src/widgets/MultiSelectWidgetV2/widget/index.tsx @@ -26,6 +26,9 @@ export function defaultOptionValueValidation( let parsed: any[] = []; let message = ""; + const DEFAULT_ERROR_MESSAGE = + "value should match: Array | Array<{label: string, value: string | number}>"; + /* * Function to check if the object has `label` and `value` */ @@ -102,8 +105,7 @@ export function defaultOptionValueValidation( * When value is [true, false], [undefined, undefined] etc. */ parsed = []; - message = - "value should match: Array | Array<{label: string, value: string | number}>"; + message = DEFAULT_ERROR_MESSAGE; } return { @@ -130,8 +132,7 @@ export function defaultOptionValueValidation( * When value is undefined, null, {} etc. */ parsed = []; - message = - "value should match: Array | Array<{label: string, value: string | number}>"; + message = DEFAULT_ERROR_MESSAGE; } return {