mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 06:46:40 +00:00
add openapi registers
This commit is contained in:
@@ -11,6 +11,7 @@ import { addPeer } from "../gerbil/peers";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { removeTargets } from "../newt/targets";
|
||||
import { getAllowedIps } from "./helpers";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
|
||||
const deleteTargetSchema = z
|
||||
.object({
|
||||
@@ -18,6 +19,17 @@ const deleteTargetSchema = z
|
||||
})
|
||||
.strict();
|
||||
|
||||
registry.registerPath({
|
||||
method: "delete",
|
||||
path: "/target/{targetId}",
|
||||
description: "Delete a target.",
|
||||
tags: [OpenAPITags.Target],
|
||||
request: {
|
||||
params: deleteTargetSchema
|
||||
},
|
||||
responses: {}
|
||||
});
|
||||
|
||||
export async function deleteTarget(
|
||||
req: Request,
|
||||
res: Response,
|
||||
|
||||
Reference in New Issue
Block a user