User can have multiple UserBrandRelationship with the same brand through different advertisers
Currently, if a user wants to create an affiliate link for a brand, the system sends the request to the first advertiser returned by the logic in:
const userBrandRelationship = await prisma.userBrandRelationship.findFirst({
where: {
user: {
id: userId,
},
brand: {
url: modifiedUrl,
},
},
include: {
brand: true,
userAdvertiserRelation: true,
brandAdvertiserRelation: true,
},
Desired end-state:
Add another tab in the user settings section (apps/web/app/app.affeasy.link/(dashboard)/settings/layout.tsx) which shows users all brands that the user is partnered with, through which advertisers (if multiple). also allow users to select which advertiser they want to use to create an affiliate link (will also have to modify function processLink in apps/web/lib/api/links.ts)
Facts:
Desired end-state:
@mentatbot can you make this happen please.