diff --git a/api/ssrApollo.js b/api/ssrApollo.js index 7f7296db..7af73317 100644 --- a/api/ssrApollo.js +++ b/api/ssrApollo.js @@ -13,6 +13,8 @@ import { BLOCK_HEIGHT } from '@/fragments/blockHeight' import { CHAIN_FEE } from '@/fragments/chainFee' import { getServerSession } from 'next-auth/next' import { getAuthOptions } from '@/pages/api/auth/[...nextauth]' +import { NOFOLLOW_LIMIT } from '@/lib/constants' +import { satsToMsats } from '@/lib/format' export default async function getSSRApolloClient ({ req, res, me = null }) { const session = req && await getServerSession(req, res, getAuthOptions(req)) @@ -64,7 +66,17 @@ function oneDayReferral (request, { me }) { let prismaPromise, getData if (referrer.startsWith('item-')) { - prismaPromise = models.item.findUnique({ where: { id: parseInt(referrer.slice(5)) } }) + prismaPromise = models.item.findUnique({ + where: { + id: parseInt(referrer.slice(5)), + msats: { + gt: satsToMsats(NOFOLLOW_LIMIT) + }, + weightedVotes: { + gt: 0 + } + } + }) getData = item => ({ referrerId: item.userId, refereeId: parseInt(me.id),