♻️ handle priority field

This commit is contained in:
Fred KISSIE
2026-09-17 21:44:56 +02:00
parent ec36317057
commit 85adae063b
9 changed files with 90 additions and 5 deletions
@@ -16,6 +16,7 @@ import {
redirectPathMatchTypeSchema,
redirectRewritePathSchema,
redirectRewritePathTypeSchema,
redirectPrioritySchema,
isValidMatchPath
} from "@server/routers/redirect/validation";
import { createCertificate } from "../certificates";
@@ -40,6 +41,7 @@ const bodySchema = z.strictObject({
matchPath: redirectMatchPathSchema.optional().nullable(),
rewritePath: redirectRewritePathSchema.optional().nullable(),
rewritePathType: redirectRewritePathTypeSchema.optional().nullable(),
priority: redirectPrioritySchema.optional(),
permanent: z.boolean().optional(),
enabled: z.boolean().optional()
});
@@ -255,6 +257,9 @@ export async function updateRedirect(
if (body.rewritePathType !== undefined) {
updateData.rewritePathType = body.rewritePathType;
}
if (body.priority !== undefined) {
updateData.priority = body.priority;
}
if (body.permanent !== undefined) {
updateData.permanent = body.permanent;
}