Skip to content

Add coin-gated text posts#742

Merged
dylanjeffers merged 11 commits intomainfrom
add-coin-gated-text-posts
Mar 31, 2026
Merged

Add coin-gated text posts#742
dylanjeffers merged 11 commits intomainfrom
add-coin-gated-text-posts

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

No description provided.

@dylanjeffers dylanjeffers force-pushed the add-coin-gated-text-posts branch from d642093 to c58b5b6 Compare March 30, 2026 18:08
@dylanjeffers dylanjeffers force-pushed the add-coin-gated-text-posts branch from c54dfd8 to e3bd7d1 Compare March 30, 2026 21:34
var balance int64
if err := rows.Scan(&mint, &balance); err == nil {
walletTokenBalances[mint] = balance
walletTokenBalances[mint] += balance
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

WHERE comments.comment_id = ANY(@ids::int[])
AND (
(comments.entity_type = 'Track' AND (@include_unlisted = true OR COALESCE(tracks.is_unlisted, false) = false))
OR comments.entity_type = 'Coin'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want coin here?

g.Post("/tracks/:trackId/downloads", app.requireAuthMiddleware, app.requireWriteScope, app.postV1TrackDownload)
g.Put("/tracks/:trackId", app.requireAuthMiddleware, app.requireWriteScope, app.putV1Track)
g.Delete("/tracks/:trackId", app.requireAuthMiddleware, app.requireWriteScope, app.deleteV1Track)
g.Get("/fan_club/feed", app.v1FanClubFeed)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add fan-club? i think we are generally moving in the direction of - instead of _

@@ -0,0 +1,396 @@
package api
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name of test is correct, but the other file should be fan_club_feed right?


return c.JSON(fiber.Map{
"data": items,
"related": fiber.Map{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the related stuff in the first place?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The related key embeds associated users and tracks directly in the response to avoid N+1 requests on the client side — the same pattern used elsewhere in the API (e.g. track comments). Without it, clients would need a separate request per comment to resolve author info and linked tracks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need linked tracks? is that a UI thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes — text posts can have a linked track (e.g. "check out this track"), so the UI needs track metadata (title, artwork) to render the post inline. Without pre-fetching it here the client would need a separate request per post to resolve the track.

@@ -14682,6 +14682,7 @@ components:
description: Type of entity that can be commented on
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also probably want the new endpoint changes in swagger too

@dylanjeffers dylanjeffers merged commit 70dbc44 into main Mar 31, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the add-coin-gated-text-posts branch March 31, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants