mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-28 02:25:23 +02:00
refactor(cloud): add deploy to external API
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
findPostgresById,
|
||||
removePostgresById,
|
||||
updatePostgresById,
|
||||
findProjectById,
|
||||
} from "@dokploy/builders";
|
||||
|
||||
export const postgresRouter = createTRPCRouter({
|
||||
@@ -35,6 +36,13 @@ export const postgresRouter = createTRPCRouter({
|
||||
await checkServiceAccess(ctx.user.authId, input.projectId, "create");
|
||||
}
|
||||
|
||||
const project = await findProjectById(input.projectId);
|
||||
if (project.adminId !== ctx.user.adminId) {
|
||||
throw new TRPCError({
|
||||
code: "UNAUTHORIZED",
|
||||
message: "You are not authorized to access this project",
|
||||
});
|
||||
}
|
||||
const newPostgres = await createPostgres(input);
|
||||
if (ctx.user.rol === "user") {
|
||||
await addNewService(ctx.user.authId, newPostgres.postgresId);
|
||||
|
||||
Reference in New Issue
Block a user