whyKirbyyCh / nudelsoup-Frontend

ad campaigns at ramen prices
0 stars 0 forks source link

Fix the typescript error in the campaign-overview page #29

Open whyKirbyy opened 3 weeks ago

whyKirbyy commented 3 weeks ago
TS2322: Type '{ productTitle: string; campaignId: string; title: string; targetAudience: string; campaignType: string; campaignGoal: string; startDate: string; stillActive: boolean; svgSrc: number; } | Campaign' is not assignable to type '{ productTitle: string; campaignId: string; title: string; targetAudience: string; campaignType: string; campaignGoal: string; startDate: string; stillActive: boolean; svgSrc: number; }'.
Type 'Campaign' is not assignable to type '{ productTitle: string; campaignId: string; title: string; targetAudience: string; campaignType: string; campaignGoal: string; startDate: string; stillActive: boolean; svgSrc: number; }'.
Types of property 'productTitle' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'. For this: **setCampaigns([...campaigns, newCampaign]);**