mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
34 lines
917 B
TypeScript
34 lines
917 B
TypeScript
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);
|
|
}),
|
|
});
|