mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: mongodb naming
This commit is contained in:
@@ -14,7 +14,7 @@ export type Mongo = typeof mongo.$inferSelect;
|
|||||||
|
|
||||||
export const createMongo = async (input: typeof apiCreateMongo._type) => {
|
export const createMongo = async (input: typeof apiCreateMongo._type) => {
|
||||||
input.appName =
|
input.appName =
|
||||||
`${input.appName}-${generatePassword(6)}` || generateAppName("postgres");
|
`${input.appName}-${generatePassword(6)}` || generateAppName("mongo");
|
||||||
if (input.appName) {
|
if (input.appName) {
|
||||||
const valid = await validUniqueServerAppName(input.appName);
|
const valid = await validUniqueServerAppName(input.appName);
|
||||||
|
|
||||||
@@ -72,12 +72,12 @@ export const findMongoById = async (mongoId: string) => {
|
|||||||
|
|
||||||
export const updateMongoById = async (
|
export const updateMongoById = async (
|
||||||
mongoId: string,
|
mongoId: string,
|
||||||
postgresData: Partial<Mongo>,
|
mongoData: Partial<Mongo>,
|
||||||
) => {
|
) => {
|
||||||
const result = await db
|
const result = await db
|
||||||
.update(mongo)
|
.update(mongo)
|
||||||
.set({
|
.set({
|
||||||
...postgresData,
|
...mongoData,
|
||||||
})
|
})
|
||||||
.where(eq(mongo.mongoId, mongoId))
|
.where(eq(mongo.mongoId, mongoId))
|
||||||
.returning();
|
.returning();
|
||||||
|
|||||||
Reference in New Issue
Block a user