refactor: migrate admin API calls to user router

This commit is contained in:
Mauricio Siu
2025-02-20 23:02:02 -06:00
parent 5a1145996d
commit 790894ab93
40 changed files with 185 additions and 159 deletions

View File

@@ -1,4 +1,3 @@
import { db } from "@/server/db";
import {
apiAssignPermissions,
apiCreateUserInvitation,
@@ -14,11 +13,9 @@ import {
getUserByToken,
removeUserById,
setupWebMonitoring,
updateAdminById,
updateUser,
} from "@dokploy/server";
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm";
import { z } from "zod";
import {
adminProcedure,
@@ -131,7 +128,7 @@ export const adminRouter = createTRPCRouter({
if (user.id !== ctx.user.ownerId) {
throw new TRPCError({
code: "UNAUTHORIZED",
message: "You are not authorized to setup this server",
message: "You are not authorized to setup the monitoring",
});
}