mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-23 05:16:38 +00:00
used zod codemod
This commit is contained in:
@@ -9,20 +9,16 @@ import createHttpError from "http-errors";
|
||||
import logger from "@server/logger";
|
||||
import { fromError } from "zod-validation-error";
|
||||
|
||||
const removeRoleResourceParamsSchema = z
|
||||
.object({
|
||||
roleId: z.string().transform(Number).pipe(z.number().int().positive())
|
||||
})
|
||||
.strict();
|
||||
const removeRoleResourceParamsSchema = z.strictObject({
|
||||
roleId: z.string().transform(Number).pipe(z.int().positive())
|
||||
});
|
||||
|
||||
const removeRoleResourceSchema = z
|
||||
.object({
|
||||
const removeRoleResourceSchema = z.strictObject({
|
||||
resourceId: z
|
||||
.string()
|
||||
.transform(Number)
|
||||
.pipe(z.number().int().positive())
|
||||
})
|
||||
.strict();
|
||||
.pipe(z.int().positive())
|
||||
});
|
||||
|
||||
export async function removeRoleResource(
|
||||
req: Request,
|
||||
|
||||
Reference in New Issue
Block a user