undo zod changes that give type error
parent
50985aba14
commit
3f172e1c33
|
@ -14,7 +14,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|||
import { Alert, Select, TextField } from "@calcom/ui";
|
||||
|
||||
import type { appDataSchema } from "../zod";
|
||||
import { defaultCurrency } from "../zod";
|
||||
import { PaypalPaymentOptions as paymentOptions } from "../zod";
|
||||
|
||||
type Option = { value: string; label: string };
|
||||
|
@ -24,7 +23,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
|||
const { getAppData, setAppData } = useAppContextWithSchema<typeof appDataSchema>();
|
||||
const price = getAppData("price");
|
||||
|
||||
const currency = getAppData("currency") || defaultCurrency;
|
||||
const currency = getAppData("currency");
|
||||
const [selectedCurrency, setSelectedCurrency] = useState(currencyOptions.find((c) => c.value === currency));
|
||||
const [currencySymbol, setCurrencySymbol] = useState(
|
||||
isAcceptedCurrencyCode(currency) ? currencySymbols[currency] : ""
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { z } from "zod";
|
||||
|
||||
import { eventTypeAppCardZod } from "@calcom/app-store/eventTypeAppCardZod";
|
||||
import { currencyOptions } from "@calcom/app-store/paypal/lib/currencyOptions";
|
||||
|
||||
const paymentOptionSchema = z.object({
|
||||
label: z.string(),
|
||||
|
@ -29,12 +28,10 @@ const VALUES: [PaymentOption, ...PaymentOption[]] = [
|
|||
];
|
||||
export const paymentOptionEnum = z.enum(VALUES);
|
||||
|
||||
export const defaultCurrency = currencyOptions[0].value;
|
||||
|
||||
export const appDataSchema = eventTypeAppCardZod.merge(
|
||||
z.object({
|
||||
price: z.number(),
|
||||
currency: z.string().default(defaultCurrency),
|
||||
currency: z.string(),
|
||||
paymentOption: z.string().optional(),
|
||||
enabled: z.boolean().optional(),
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue