mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-01 12:05:23 +02:00
feat: enhance domain validation by trimming whitespace from host input
- Updated the domain validation schema to ensure the host string does not have leading or trailing spaces. - Added a refinement to the host field to validate and transform the input accordingly. - Adjusted the create and update domain functions to trim the host value before saving to the database.
This commit is contained in:
@@ -19,6 +19,7 @@ export const createDomain = async (input: typeof apiCreateDomain._type) => {
|
||||
.insert(domains)
|
||||
.values({
|
||||
...input,
|
||||
host: input.host?.trim(),
|
||||
})
|
||||
.returning()
|
||||
.then((response) => response[0]);
|
||||
@@ -120,6 +121,7 @@ export const updateDomainById = async (
|
||||
.update(domains)
|
||||
.set({
|
||||
...domainData,
|
||||
...(domainData.host && { host: domainData.host.trim() }),
|
||||
})
|
||||
.where(eq(domains.domainId, domainId))
|
||||
.returning();
|
||||
|
||||
Reference in New Issue
Block a user