mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: slugify and add hash to appName
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { generateAppName } from "./utils";
|
||||
import { registry } from "./registry";
|
||||
import { generatePassword } from "@/templates/utils";
|
||||
|
||||
export const sourceType = pgEnum("sourceType", ["docker", "git", "github"]);
|
||||
|
||||
@@ -307,12 +308,17 @@ const createSchema = createInsertSchema(applications, {
|
||||
networkSwarm: NetworkSwarmSchema.nullable(),
|
||||
});
|
||||
|
||||
export const apiCreateApplication = createSchema.pick({
|
||||
name: true,
|
||||
appName: true,
|
||||
description: true,
|
||||
projectId: true,
|
||||
});
|
||||
export const apiCreateApplication = createSchema
|
||||
.pick({
|
||||
name: true,
|
||||
appName: true,
|
||||
description: true,
|
||||
projectId: true,
|
||||
})
|
||||
.transform((data) => ({
|
||||
...data,
|
||||
appName: `${data.appName}-${generatePassword(6)}` || generateAppName("app"),
|
||||
}));
|
||||
|
||||
export const apiFindOneApplication = createSchema
|
||||
.pick({
|
||||
|
||||
Reference in New Issue
Block a user