Skip to content

Commit

Permalink
rename request zod schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Dec 11, 2024
1 parent 81f0690 commit ce14be4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Plans } from 'shared/utils/billing'
import { AlertOptions, type AlertOptionsType } from 'ui/Alert'

import CurrentOrgPlan from './CurrentOrgPlan'
import { RequestSchema as EnterpriseAccountDetailsQueryOptsSchema } from './queries/EnterpriseAccountDetailsQueryOpts'
import { EnterpriseAccountDetailsRequestSchema } from './queries/EnterpriseAccountDetailsQueryOpts'

vi.mock('./BillingDetails', () => ({ default: () => 'BillingDetails' }))
vi.mock('./CurrentPlanCard', () => ({ default: () => 'CurrentPlanCard' }))
Expand Down Expand Up @@ -138,7 +138,7 @@ afterAll(() => {
interface SetupArgs {
accountDetails?: z.infer<typeof AccountDetailsSchema>
enterpriseAccountDetails?: z.infer<
typeof EnterpriseAccountDetailsQueryOptsSchema
typeof EnterpriseAccountDetailsRequestSchema
>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const AccountSchema = z.object({

export type Account = z.infer<typeof AccountSchema>

export const RequestSchema = z.object({
export const EnterpriseAccountDetailsRequestSchema = z.object({
owner: z
.object({
account: AccountSchema.nullable(),
Expand Down Expand Up @@ -56,7 +56,9 @@ export function EnterpriseAccountDetailsQueryOpts({
owner,
},
}).then((res) => {
const parsedRes = RequestSchema.safeParse(res?.data)
const parsedRes = EnterpriseAccountDetailsRequestSchema.safeParse(
res?.data
)

if (!parsedRes.success) {
return rejectNetworkError({
Expand Down

0 comments on commit ce14be4

Please sign in to comment.