Skip to content

Commit

Permalink
Use code query parameter for zod error path
Browse files Browse the repository at this point in the history
  • Loading branch information
realjokele committed Mar 6, 2024
1 parent b6ececc commit cde86e2
Show file tree
Hide file tree
Showing 58 changed files with 59 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function validateRequest(
const codeIsValid = true
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function validateRequest(
const codeIsValid = true
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function validateRequest(
const codeIsValid = true
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function validateRequest(
const codeIsValid = true
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function validateRequest(
const codeIsValid = true
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function validateRequest(
})
if (!verification) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand All @@ -95,7 +95,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function validateRequest(
})
if (!codeIsValid) {
ctx.addIssue({
path: ['code'],
path: [codeQueryParam],
code: z.ZodIssueCode.custom,
message: `Invalid code`,
})
Expand Down
Loading

0 comments on commit cde86e2

Please sign in to comment.