diff --git a/src/form/fragmentUtil.ts b/src/form/fragmentUtil.ts index d95fd1ea..2892fac8 100644 --- a/src/form/fragmentUtil.ts +++ b/src/form/fragmentUtil.ts @@ -47,15 +47,15 @@ export function createAdSetFromFragment( data: AdSetFragment, campaignId?: string, ): CreateAdSetInput { + const ads = (data.ads ?? []).filter((ad) => ad.state !== "deleted"); + return { campaignId, - ads: (data.ads ?? []) - .filter((ad) => ad.state !== "deleted") - .map((ad) => ({ - creativeId: ad.creative.id, - price: ad.price, - priceType: ad.priceType, - })), + ads: ads.map((ad) => ({ + creativeId: ad.creative.id, + creativeSetId: data.id, + })), + price: ads[0].price, bannedKeywords: data.bannedKeywords, billingType: data.billingType ?? "cpm", conversions: (data.conversions ?? []).map((c) => ({ diff --git a/src/graphql/types.ts b/src/graphql/types.ts index 0c03884f..4c5763b5 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -82,13 +82,15 @@ export enum CampaignSource { export type ChangeFilter = { /** exclude all changes whose time range is completely before this time */ - created?: InputMaybe; + createdAfter?: InputMaybe; /** include changes made by system user */ includeSystemUser?: InputMaybe; /** limit the amount of results returned */ limit?: InputMaybe; /** only include changes for this reference id */ referenceId?: InputMaybe; + /** only include changes for this set of reference ids */ + referenceIds?: InputMaybe>; }; export enum ConfirmationType {