Skip to content

Commit

Permalink
[wip] remove partner offer from primary label
Browse files Browse the repository at this point in the history
  • Loading branch information
starsirius committed Nov 7, 2024
1 parent f8bd2f8 commit f555482
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/schema/v2/artwork/collectorSignals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const CollectorSignals: GraphQLFieldConfig<any, ResolverContext> = {
}),
}

type PrimaryLabel = "PARTNER_OFFER" | "INCREASED_INTEREST" | "CURATORS_PICK"
type PrimaryLabel = "INCREASED_INTEREST" | "CURATORS_PICK"

// Single function to resolve mutually-exclusive label signals
const getPrimaryLabel = async (
Expand All @@ -214,23 +214,13 @@ const getPrimaryLabel = async (
}

const ignoreLabels = args.ignore
const partnerOfferPromise =
!ignoreLabels?.includes("PARTNER_OFFER") &&
getActivePartnerOffer(artwork, ctx)
const curatorsPickPromise =
!ignoreLabels?.includes("CURATORS_PICK") && getIsCuratorsPick(artwork, ctx)
const increasedInterest =
!ignoreLabels?.includes("INCREASED_INTEREST") &&
getIncreasedInterest(artwork)

const [activePartnerOffer, curatorsPick] = await Promise.all([
partnerOfferPromise,
curatorsPickPromise,
])

if (activePartnerOffer) {
return "PARTNER_OFFER"
}
const [curatorsPick] = await Promise.all([curatorsPickPromise])

if (curatorsPick) {
return "CURATORS_PICK"
Expand Down

0 comments on commit f555482

Please sign in to comment.