Fixed banner seed.
This commit is contained in:
@@ -996,6 +996,10 @@ async function scan(dir) {
|
||||
}
|
||||
|
||||
function getAffiliateId(affiliate) {
|
||||
if (!affiliate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (affiliate.id) {
|
||||
return affiliate.id;
|
||||
}
|
||||
@@ -1030,14 +1034,15 @@ exports.seed = async (knex) => {
|
||||
network: network === 'banners' ? channel : network,
|
||||
channel: network === 'banners' ? null : channel,
|
||||
affiliateId,
|
||||
affiliate: affiliate?.id,
|
||||
affiliate: getAffiliateId(affiliate),
|
||||
banner,
|
||||
width: Number(width),
|
||||
height: Number(height),
|
||||
type,
|
||||
tags,
|
||||
};
|
||||
}).filter((banner) => !!banner.affiliate);
|
||||
// }).filter((banner) => !!banner.affiliate);
|
||||
});
|
||||
|
||||
await Promise.all([
|
||||
knex('campaigns').delete(),
|
||||
|
||||
Reference in New Issue
Block a user