mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 01:55:10 +02:00
render targets in table, update targets
This commit is contained in:
parent
93ea7e4620
commit
cf3cf4d827
16 changed files with 744 additions and 472 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Request, Response, NextFunction } from "express";
|
||||
import { z } from "zod";
|
||||
import { db } from "@server/db";
|
||||
import { resources, sites, targets } from "@server/db/schema";
|
||||
import { resources, sites, Target, targets } from "@server/db/schema";
|
||||
import response from "@server/utils/response";
|
||||
import HttpCode from "@server/types/HttpCode";
|
||||
import createHttpError from "http-errors";
|
||||
|
@ -23,6 +23,8 @@ const createTargetSchema = z.object({
|
|||
enabled: z.boolean().default(true),
|
||||
});
|
||||
|
||||
export type CreateTargetResponse = Target;
|
||||
|
||||
export async function createTarget(
|
||||
req: Request,
|
||||
res: Response,
|
||||
|
@ -126,7 +128,7 @@ export async function createTarget(
|
|||
allowedIps: targetIps.flat(),
|
||||
});
|
||||
|
||||
return response(res, {
|
||||
return response<CreateTargetResponse>(res, {
|
||||
data: newTarget[0],
|
||||
success: true,
|
||||
error: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue