mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: initial commit
This commit is contained in:
33
server/api/routers/security.ts
Normal file
33
server/api/routers/security.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { createTRPCRouter, protectedProcedure } from "../trpc";
|
||||
import {
|
||||
apiCreateSecurity,
|
||||
apiFindOneSecurity,
|
||||
apiUpdateSecurity,
|
||||
} from "@/server/db/schema";
|
||||
import {
|
||||
createSecurity,
|
||||
deleteSecurityById,
|
||||
findSecurityById,
|
||||
updateSecurityById,
|
||||
} from "../services/security";
|
||||
|
||||
export const securityRouter = createTRPCRouter({
|
||||
create: protectedProcedure
|
||||
.input(apiCreateSecurity)
|
||||
.mutation(async ({ input }) => {
|
||||
return await createSecurity(input);
|
||||
}),
|
||||
one: protectedProcedure.input(apiFindOneSecurity).query(async ({ input }) => {
|
||||
return await findSecurityById(input.securityId);
|
||||
}),
|
||||
delete: protectedProcedure
|
||||
.input(apiFindOneSecurity)
|
||||
.mutation(async ({ input }) => {
|
||||
return await deleteSecurityById(input.securityId);
|
||||
}),
|
||||
update: protectedProcedure
|
||||
.input(apiUpdateSecurity)
|
||||
.mutation(async ({ input }) => {
|
||||
return await updateSecurityById(input.securityId, input);
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user