diff --git a/src/graphql/advertiser.generated.tsx b/src/graphql/advertiser.generated.tsx index 84da971a1..47198806c 100644 --- a/src/graphql/advertiser.generated.tsx +++ b/src/graphql/advertiser.generated.tsx @@ -133,7 +133,7 @@ export type AdvertiserPriceFragment = { billingModelPrice: string; billingType: Types.BillingType; format: Types.CampaignFormat; - isPrimary: boolean; + isPrimaryFormat: boolean; }; export type AdvertiserImagesQueryVariables = Types.Exact<{ @@ -162,7 +162,7 @@ export type AdvertiserPricesQuery = { billingModelPrice: string; billingType: Types.BillingType; format: Types.CampaignFormat; - isPrimary: boolean; + isPrimaryFormat: boolean; }>; } | null; }; @@ -231,7 +231,7 @@ export const AdvertiserPriceFragmentDoc = gql` billingModelPrice billingType format - isPrimary + isPrimaryFormat } `; export const AdvertiserDocument = gql` diff --git a/src/graphql/advertiser.graphql b/src/graphql/advertiser.graphql index ca1fbbd59..9aade45b1 100644 --- a/src/graphql/advertiser.graphql +++ b/src/graphql/advertiser.graphql @@ -67,7 +67,7 @@ fragment AdvertiserPrice on AdvertiserPrice { billingModelPrice billingType format - isPrimary + isPrimaryFormat } query advertiserImages($id: String!) { diff --git a/src/graphql/types.ts b/src/graphql/types.ts index 14ce85bce..c51133bb8 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -44,7 +44,7 @@ export type AdvertiserPriceInput = { billingModelPrice: Scalars["Numeric"]["input"]; billingType: BillingType; format: CampaignFormat; - isPrimary?: Scalars["Boolean"]["input"]; + isPrimaryFormat?: Scalars["Boolean"]["input"]; }; export enum AdvertiserSource { diff --git a/src/user/views/adsManager/types/index.ts b/src/user/views/adsManager/types/index.ts index ac73c29c1..2878deceb 100644 --- a/src/user/views/adsManager/types/index.ts +++ b/src/user/views/adsManager/types/index.ts @@ -113,7 +113,7 @@ export const initialCampaign = ( ): CampaignForm => { const format = CampaignFormat.PushNotification; const price = advertiser.prices.find( - (p) => p.format === format && p.isPrimary, + (p) => p.format === format && p.isPrimaryFormat, ); return { isCreating: false, diff --git a/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx b/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx index 92bc47bae..92dcde244 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx @@ -46,7 +46,7 @@ const FormatItemButton = (props: { format: CampaignFormat } & PriceProps) => { onClick={() => { format.setValue(props.format); const found = props.prices.find( - (p) => p.format === props.format && p.isPrimary, + (p) => p.format === props.format && p.isPrimaryFormat, ); if (props.format === CampaignFormat.NewsDisplayAd) { price.setValue(found?.billingModelPrice ?? "10"); diff --git a/src/validation/CampaignSchema.test.ts b/src/validation/CampaignSchema.test.ts index b813b8a96..64847832d 100644 --- a/src/validation/CampaignSchema.test.ts +++ b/src/validation/CampaignSchema.test.ts @@ -14,13 +14,13 @@ const prices: Omit[] = [ format: CampaignFormat.PushNotification, billingModelPrice: "6", billingType: BillingType.Cpm, - isPrimary: true, + isPrimaryFormat: true, }, { format: CampaignFormat.PushNotification, billingModelPrice: ".15", billingType: BillingType.Cpc, - isPrimary: true, + isPrimaryFormat: true, }, ]; diff --git a/src/validation/CampaignSchema.tsx b/src/validation/CampaignSchema.tsx index 6b8f482fc..0f318b8d0 100644 --- a/src/validation/CampaignSchema.tsx +++ b/src/validation/CampaignSchema.tsx @@ -183,7 +183,8 @@ export function findPrice( schema: StringSchema, ) { const found = prices.find( - (p) => p.format === format && p.billingType === billingType && p.isPrimary, + (p) => + p.format === format && p.billingType === billingType && p.isPrimaryFormat, ); const price = BigNumber(found?.billingModelPrice ?? defaultPrice); return schema.test(