fix: Not able to create a portal if the custom domain is empty (#6224)

This commit is contained in:
Sivin Varghese
2023-01-10 20:50:35 +05:30
committed by GitHub
parent c16624dc5d
commit 14382ad881

View File

@@ -18,6 +18,9 @@ export const isValidPassword = value => {
};
export const isNumber = value => /^\d+$/.test(value);
export const isDomain = value => {
const domainRegex = /^([\p{L}0-9]+(-[\p{L}0-9]+)*\.)+[a-z]{2,}$/gmu;
return domainRegex.test(value);
if (value !== '') {
const domainRegex = /^([\p{L}0-9]+(-[\p{L}0-9]+)*\.)+[a-z]{2,}$/gmu;
return domainRegex.test(value);
}
return true;
};