Skip to content

Commit

Permalink
πŸ› Fix campaign innerJoin
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Jul 25, 2024
1 parent 8539301 commit 1c4df09
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/ponder/src/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 1c4df09

Please sign in to comment.