Handling independent channel banner configurations.
This commit is contained in:
@@ -1070,16 +1070,19 @@ exports.seed = async (knex) => {
|
||||
|
||||
const affiliate = affiliates.find((aff) => aff.id === affiliateId)
|
||||
|| affiliates.find((aff) => aff.channel === resolvedChannel)
|
||||
|| affiliates.find((aff) => aff.network === resolvedNetwork);
|
||||
|| affiliates.find((aff) => aff.network === resolvedNetwork)
|
||||
|| affiliates.find((aff) => aff.channel === resolvedNetwork); // independent channel
|
||||
|
||||
if (!affiliate) {
|
||||
console.warn('UNMATCHED AFFILIATE', file);
|
||||
}
|
||||
|
||||
const isIndependent = affiliate?.channel && affiliate.channel === resolvedNetwork;
|
||||
|
||||
return {
|
||||
file,
|
||||
network: resolvedNetwork,
|
||||
channel: resolvedChannel,
|
||||
network: isIndependent ? null : resolvedNetwork,
|
||||
channel: isIndependent ? resolvedNetwork : resolvedChannel,
|
||||
affiliateId,
|
||||
affiliate: getAffiliateId(affiliate),
|
||||
banner,
|
||||
|
||||
Reference in New Issue
Block a user