mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-14 17:06:39 +00:00
used zod codemod
This commit is contained in:
@@ -16,21 +16,17 @@ import { build } from "@server/build";
|
||||
import { getOrgTierData } from "#dynamic/lib/billing";
|
||||
import { TierId } from "@server/lib/billing/tiers";
|
||||
|
||||
const paramsSchema = z
|
||||
.object({
|
||||
const paramsSchema = z.strictObject({
|
||||
orgId: z.string().nonempty()
|
||||
})
|
||||
.strict();
|
||||
});
|
||||
|
||||
const bodySchema = z
|
||||
.object({
|
||||
email: z
|
||||
.string()
|
||||
const bodySchema = z.strictObject({
|
||||
email: z.email()
|
||||
.toLowerCase()
|
||||
.optional()
|
||||
.refine((data) => {
|
||||
if (data) {
|
||||
return z.string().email().safeParse(data).success;
|
||||
return z.email().safeParse(data).success;
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
@@ -39,8 +35,7 @@ const bodySchema = z
|
||||
type: z.enum(["internal", "oidc"]).optional(),
|
||||
idpId: z.number().optional(),
|
||||
roleId: z.number()
|
||||
})
|
||||
.strict();
|
||||
});
|
||||
|
||||
export type CreateOrgUserResponse = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user