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)
|
const affiliate = affiliates.find((aff) => aff.id === affiliateId)
|
||||||
|| affiliates.find((aff) => aff.channel === resolvedChannel)
|
|| 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) {
|
if (!affiliate) {
|
||||||
console.warn('UNMATCHED AFFILIATE', file);
|
console.warn('UNMATCHED AFFILIATE', file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isIndependent = affiliate?.channel && affiliate.channel === resolvedNetwork;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
file,
|
file,
|
||||||
network: resolvedNetwork,
|
network: isIndependent ? null : resolvedNetwork,
|
||||||
channel: resolvedChannel,
|
channel: isIndependent ? resolvedNetwork : resolvedChannel,
|
||||||
affiliateId,
|
affiliateId,
|
||||||
affiliate: getAffiliateId(affiliate),
|
affiliate: getAffiliateId(affiliate),
|
||||||
banner,
|
banner,
|
||||||
|
|||||||
Reference in New Issue
Block a user