mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-05 11:42:17 +00:00
Fix variable naming in database routers
Co-authored-by: Siumauricio <[email protected]>
This commit is contained in:
co-authored by
Siumauricio
parent
139c06b63d
commit
a86fe46b7b
@@ -163,9 +163,9 @@ export const mariadbRouter = createTRPCRouter({
|
|||||||
saveExternalPort: protectedProcedure
|
saveExternalPort: protectedProcedure
|
||||||
.input(apiSaveExternalPortMariaDB)
|
.input(apiSaveExternalPortMariaDB)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const mongo = await findMariadbById(input.mariadbId);
|
const mariadb = await findMariadbById(input.mariadbId);
|
||||||
if (
|
if (
|
||||||
mongo.environment.project.organizationId !==
|
mariadb.environment.project.organizationId !==
|
||||||
ctx.session.activeOrganizationId
|
ctx.session.activeOrganizationId
|
||||||
) {
|
) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -177,7 +177,7 @@ export const mariadbRouter = createTRPCRouter({
|
|||||||
if (input.externalPort) {
|
if (input.externalPort) {
|
||||||
const portCheck = await checkPortInUse(
|
const portCheck = await checkPortInUse(
|
||||||
input.externalPort,
|
input.externalPort,
|
||||||
mongo.serverId || undefined,
|
mariadb.serverId || undefined,
|
||||||
);
|
);
|
||||||
if (portCheck.isInUse) {
|
if (portCheck.isInUse) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -191,7 +191,7 @@ export const mariadbRouter = createTRPCRouter({
|
|||||||
externalPort: input.externalPort,
|
externalPort: input.externalPort,
|
||||||
});
|
});
|
||||||
await deployMariadb(input.mariadbId);
|
await deployMariadb(input.mariadbId);
|
||||||
return mongo;
|
return mariadb;
|
||||||
}),
|
}),
|
||||||
deploy: protectedProcedure
|
deploy: protectedProcedure
|
||||||
.input(apiDeployMariaDB)
|
.input(apiDeployMariaDB)
|
||||||
|
|||||||
@@ -178,9 +178,9 @@ export const mysqlRouter = createTRPCRouter({
|
|||||||
saveExternalPort: protectedProcedure
|
saveExternalPort: protectedProcedure
|
||||||
.input(apiSaveExternalPortMySql)
|
.input(apiSaveExternalPortMySql)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const mongo = await findMySqlById(input.mysqlId);
|
const mysql = await findMySqlById(input.mysqlId);
|
||||||
if (
|
if (
|
||||||
mongo.environment.project.organizationId !==
|
mysql.environment.project.organizationId !==
|
||||||
ctx.session.activeOrganizationId
|
ctx.session.activeOrganizationId
|
||||||
) {
|
) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -192,7 +192,7 @@ export const mysqlRouter = createTRPCRouter({
|
|||||||
if (input.externalPort) {
|
if (input.externalPort) {
|
||||||
const portCheck = await checkPortInUse(
|
const portCheck = await checkPortInUse(
|
||||||
input.externalPort,
|
input.externalPort,
|
||||||
mongo.serverId || undefined,
|
mysql.serverId || undefined,
|
||||||
);
|
);
|
||||||
if (portCheck.isInUse) {
|
if (portCheck.isInUse) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -206,7 +206,7 @@ export const mysqlRouter = createTRPCRouter({
|
|||||||
externalPort: input.externalPort,
|
externalPort: input.externalPort,
|
||||||
});
|
});
|
||||||
await deployMySql(input.mysqlId);
|
await deployMySql(input.mysqlId);
|
||||||
return mongo;
|
return mysql;
|
||||||
}),
|
}),
|
||||||
deploy: protectedProcedure
|
deploy: protectedProcedure
|
||||||
.input(apiDeployMySql)
|
.input(apiDeployMySql)
|
||||||
|
|||||||
@@ -202,9 +202,9 @@ export const redisRouter = createTRPCRouter({
|
|||||||
saveExternalPort: protectedProcedure
|
saveExternalPort: protectedProcedure
|
||||||
.input(apiSaveExternalPortRedis)
|
.input(apiSaveExternalPortRedis)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const mongo = await findRedisById(input.redisId);
|
const redis = await findRedisById(input.redisId);
|
||||||
if (
|
if (
|
||||||
mongo.environment.project.organizationId !==
|
redis.environment.project.organizationId !==
|
||||||
ctx.session.activeOrganizationId
|
ctx.session.activeOrganizationId
|
||||||
) {
|
) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -216,7 +216,7 @@ export const redisRouter = createTRPCRouter({
|
|||||||
if (input.externalPort) {
|
if (input.externalPort) {
|
||||||
const portCheck = await checkPortInUse(
|
const portCheck = await checkPortInUse(
|
||||||
input.externalPort,
|
input.externalPort,
|
||||||
mongo.serverId || undefined,
|
redis.serverId || undefined,
|
||||||
);
|
);
|
||||||
if (portCheck.isInUse) {
|
if (portCheck.isInUse) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -230,7 +230,7 @@ export const redisRouter = createTRPCRouter({
|
|||||||
externalPort: input.externalPort,
|
externalPort: input.externalPort,
|
||||||
});
|
});
|
||||||
await deployRedis(input.redisId);
|
await deployRedis(input.redisId);
|
||||||
return mongo;
|
return redis;
|
||||||
}),
|
}),
|
||||||
deploy: protectedProcedure
|
deploy: protectedProcedure
|
||||||
.input(apiDeployRedis)
|
.input(apiDeployRedis)
|
||||||
|
|||||||
Reference in New Issue
Block a user