Skip to content

Commit

Permalink
fix: variable rename
Browse files Browse the repository at this point in the history
  • Loading branch information
IanKrieger committed Oct 30, 2023
1 parent 4e6c3ce commit d533850
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/graphql/advertiser.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/graphql/advertiser.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fragment AdvertiserPrice on AdvertiserPrice {
billingModelPrice
billingType
format
isPrimary
isPrimaryFormat
}

query advertiserImages($id: String!) {
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/user/views/adsManager/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/validation/CampaignSchema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const prices: Omit<AdvertiserPriceFragment, "isDefault">[] = [
format: CampaignFormat.PushNotification,
billingModelPrice: "6",
billingType: BillingType.Cpm,
isPrimary: true,
isPrimaryFormat: true,
},
{
format: CampaignFormat.PushNotification,
billingModelPrice: ".15",
billingType: BillingType.Cpc,
isPrimary: true,
isPrimaryFormat: true,
},
];

Expand Down
3 changes: 2 additions & 1 deletion src/validation/CampaignSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ export function findPrice(
schema: StringSchema<string | undefined, AnyObject, undefined, "">,
) {
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(
Expand Down

0 comments on commit d533850

Please sign in to comment.