mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: initial commit
This commit is contained in:
20
server/api/routers/user.ts
Normal file
20
server/api/routers/user.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { apiFindOneUser, apiFindOneUserByAuth } from "@/server/db/schema";
|
||||
import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc";
|
||||
|
||||
import { findUserByAuthId, findUserById, findUsers } from "../services/user";
|
||||
|
||||
export const userRouter = createTRPCRouter({
|
||||
all: adminProcedure.query(async () => {
|
||||
return await findUsers();
|
||||
}),
|
||||
byAuthId: protectedProcedure
|
||||
.input(apiFindOneUserByAuth)
|
||||
.query(async ({ input }) => {
|
||||
return await findUserByAuthId(input.authId);
|
||||
}),
|
||||
byUserId: protectedProcedure
|
||||
.input(apiFindOneUser)
|
||||
.query(async ({ input }) => {
|
||||
return await findUserById(input.userId);
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user