Allow null in multichannel campaign. (#41180)

This commit is contained in:
Gan Eng Chin 2023-11-03 21:17:16 +08:00 committed by GitHub
commit eac4258baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -58,7 +58,7 @@ export type Campaign = {
cost: {
value: string;
currency: string;
};
} | null;
};
export type CampaignsPage = {

View File

@ -46,11 +46,15 @@ export const useCampaigns = ( page = 1, perPage = 5 ): UseCampaignsType => {
( el ) => el.slug === campaign.channel
);
const cost = campaign.cost
? `${ campaign.cost.currency } ${ campaign.cost.value }`
: '';
return {
id: `${ campaign.channel }|${ campaign.id }`,
title: campaign.title,
description: '',
cost: `${ campaign.cost.currency } ${ campaign.cost.value }`,
cost,
manageUrl: campaign.manage_url,
icon: channel?.icon || '',
channelName: channel?.title || '',

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Allow null value in cost field for multichannel campaign.