From 1c4df09a3cc2306cf2e024c8d8515efac2b4dac0 Mon Sep 17 00:00:00 2001 From: KONFeature Date: Thu, 25 Jul 2024 13:27:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20campaign=20innerJoin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ponder/src/api/admin.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/ponder/src/api/admin.ts b/packages/ponder/src/api/admin.ts index b97841d..0b61bbf 100644 --- a/packages/ponder/src/api/admin.ts +++ b/packages/ponder/src/api/admin.ts @@ -67,7 +67,10 @@ ponder.get("/admin/:wallet/campaigns", async (ctx) => { detachTimestamp: Campaign.detachTimestamp, }) .from(ContentAdministrator) - .innerJoin(Campaign, eq(ContentAdministrator.contentId, Campaign.id)) + .innerJoin( + Campaign, + eq(ContentAdministrator.contentId, Campaign.contentId) + ) .where(eq(ContentAdministrator.user, wallet)); // Return the result as json @@ -100,10 +103,13 @@ ponder.get("/admin/:wallet/campaigns/stats", async (ctx) => { totalRewards: PressCampaignStats.totalRewards, }) .from(ContentAdministrator) - .innerJoin(Campaign, eq(ContentAdministrator.contentId, Campaign.id)) + .innerJoin( + Campaign, + eq(ContentAdministrator.contentId, Campaign.contentId) + ) .innerJoin( PressCampaignStats, - eq(Campaign.contentId, PressCampaignStats.campaignId) + eq(Campaign.id, PressCampaignStats.campaignId) ) .where(eq(ContentAdministrator.user, wallet));