Skip to content

Commit d18fe83

Browse files
authored
Merge pull request #3082 from Dokploy/3077-cant-put-space-in-services-name
fix: update input handling in application components
2 parents a5abd46 + e88a9ce commit d18fe83

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

apps/dokploy/components/dashboard/project/add-application.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ export const AddApplication = ({ environmentId, projectName }: Props) => {
150150
placeholder="Frontend"
151151
{...field}
152152
onChange={(e) => {
153-
const val = e.target.value?.trim() || "";
154-
const serviceName = slugify(val);
153+
const val = e.target.value || "";
154+
const serviceName = slugify(val.trim());
155155
form.setValue("appName", `${slug}-${serviceName}`);
156156
field.onChange(val);
157157
}}

apps/dokploy/components/dashboard/project/add-compose.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ export const AddCompose = ({ environmentId, projectName }: Props) => {
161161
placeholder="Frontend"
162162
{...field}
163163
onChange={(e) => {
164-
const val = e.target.value?.trim() || "";
165-
const serviceName = slugify(val);
164+
const val = e.target.value || "";
165+
const serviceName = slugify(val.trim());
166166
form.setValue("appName", `${slug}-${serviceName}`);
167167
field.onChange(val);
168168
}}

apps/dokploy/components/dashboard/project/add-database.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ export const AddDatabase = ({ environmentId, projectName }: Props) => {
395395
placeholder="Name"
396396
{...field}
397397
onChange={(e) => {
398-
const val = e.target.value?.trim() || "";
399-
const serviceName = slugify(val);
398+
const val = e.target.value || "";
399+
const serviceName = slugify(val.trim());
400400
form.setValue("appName", `${slug}-${serviceName}`);
401401
field.onChange(val);
402402
}}

0 commit comments

Comments
 (0)