mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-01 00:06:38 +00:00
Merge dev into fix/log-analytics-adjustments
This commit is contained in:
@@ -11,11 +11,8 @@ import logger from "@server/logger";
|
||||
import { OpenAPITags, registry } from "@server/openApi";
|
||||
|
||||
const listTargetsParamsSchema = z.strictObject({
|
||||
resourceId: z
|
||||
.string()
|
||||
.transform(Number)
|
||||
.pipe(z.int().positive())
|
||||
});
|
||||
resourceId: z.string().transform(Number).pipe(z.int().positive())
|
||||
});
|
||||
|
||||
const listTargetsSchema = z.object({
|
||||
limit: z
|
||||
@@ -62,7 +59,7 @@ function queryTargets(resourceId: number) {
|
||||
pathMatchType: targets.pathMatchType,
|
||||
rewritePath: targets.rewritePath,
|
||||
rewritePathType: targets.rewritePathType,
|
||||
priority: targets.priority,
|
||||
priority: targets.priority
|
||||
})
|
||||
.from(targets)
|
||||
.leftJoin(sites, eq(sites.siteId, targets.siteId))
|
||||
@@ -75,8 +72,11 @@ function queryTargets(resourceId: number) {
|
||||
return baseQuery;
|
||||
}
|
||||
|
||||
type TargetWithParsedHeaders = Omit<Awaited<ReturnType<typeof queryTargets>>[0], 'hcHeaders'> & {
|
||||
hcHeaders: { name: string; value: string; }[] | null;
|
||||
type TargetWithParsedHeaders = Omit<
|
||||
Awaited<ReturnType<typeof queryTargets>>[0],
|
||||
"hcHeaders"
|
||||
> & {
|
||||
hcHeaders: { name: string; value: string }[] | null;
|
||||
};
|
||||
|
||||
export type ListTargetsResponse = {
|
||||
@@ -136,7 +136,7 @@ export async function listTargets(
|
||||
const totalCount = totalCountResult[0].count;
|
||||
|
||||
// Parse hcHeaders from JSON string back to array for each target
|
||||
const parsedTargetsList = targetsList.map(target => {
|
||||
const parsedTargetsList = targetsList.map((target) => {
|
||||
let parsedHcHeaders = null;
|
||||
if (target.hcHeaders) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user