mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-20 01:29:47 +02:00
♻️ handle priority field
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user