Generate valid appName on changing name

The same can probably also be done at other places. Should probably be solved in a generic way.
This commit is contained in:
Michiel Crefcoeur
2024-09-16 07:25:16 -07:00
committed by GitHub
parent b419da427f
commit 4f3eb7b362

View File

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