MCPcopy
hub / github.com/Dokploy/dokploy / deleteSecurityById

Function deleteSecurityById

packages/server/src/services/security.ts:60–87  ·  view source on GitHub ↗
(securityId: string)

Source from the content-addressed store, hash-verified

58};
59
60export const deleteSecurityById = async (securityId: string) => {
61 try {
62 const result = await db
63 .delete(security)
64 .where(eq(security.securityId, securityId))
65 .returning()
66 .then((res) => res[0]);
67
68 if (!result) {
69 throw new TRPCError({
70 code: "NOT_FOUND",
71 message: "Security not found",
72 });
73 }
74
75 const application = await findApplicationById(result.applicationId);
76
77 await removeSecurityMiddleware(application, result);
78 return result;
79 } catch (error) {
80 const message =
81 error instanceof Error ? error.message : "Error removing this security";
82 throw new TRPCError({
83 code: "BAD_REQUEST",
84 message,
85 });
86 }
87};
88
89export const updateSecurityById = async (
90 securityId: string,

Callers 1

security.tsFile · 0.90

Calls 2

findApplicationByIdFunction · 0.90
removeSecurityMiddlewareFunction · 0.90

Tested by

no test coverage detected