corrections

This commit is contained in:
Michiel Crefcoeur
2024-09-16 22:13:30 +02:00
committed by GitHub
parent e1ec0aee69
commit 2f9448dde9
3 changed files with 6 additions and 6 deletions

View File

@@ -125,8 +125,8 @@ export const AddApplication = ({ projectId, projectName }: Props) => {
placeholder="Frontend"
{...field}
onChange={(e) => {
const val = e.target.value?.trim().toLowerCase().replaceAll(" ", "-") || "";
form.setValue("appName", `${slug}-${val}`);
const val = e.target.value?.trim() || "";
form.setValue("appName", `${slug}-${val.toLowerCase().replaceAll(" ", "-")}`);
field.onChange(val);
}}
/>

View File

@@ -137,8 +137,8 @@ export const AddCompose = ({ projectId, projectName }: Props) => {
placeholder="Frontend"
{...field}
onChange={(e) => {
const val = e.target.value?.trim().toLowerCase() || "";
form.setValue("appName", `${slug}-${val}`);
const val = e.target.value?.trim() || "";
form.setValue("appName", `${slug}-${val.toLowerCase()}`);
field.onChange(val);
}}
/>

View File

@@ -341,8 +341,8 @@ export const AddDatabase = ({ projectId, projectName }: Props) => {
placeholder="Name"
{...field}
onChange={(e) => {
const val = e.target.value?.trim().toLowerCase() || "";
form.setValue("appName", `${slug}-${val}`);
const val = e.target.value?.trim() || "";
form.setValue("appName", `${slug}-${val.toLowerCase()}`);
field.onChange(val);
}}
/>