Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions api/dbv1/full_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (q *Queries) FullCommentsKeyed(ctx context.Context, arg GetCommentsParams)
SELECT 1
FROM comment_reactions
WHERE comment_id = comments.comment_id
AND user_id = COALESCE(tracks.owner_id, events.user_id, comments.entity_id)
AND user_id = COALESCE(tracks.owner_id, comments.entity_id)
AND is_delete = false
) AS is_artist_reacted,

Expand All @@ -128,13 +128,11 @@ func (q *Queries) FullCommentsKeyed(ctx context.Context, arg GetCommentsParams)

FROM comments
LEFT JOIN tracks ON comments.entity_type = 'Track' AND comments.entity_id = tracks.track_id
LEFT JOIN events ON comments.entity_type = 'Event' AND comments.entity_id = events.event_id
LEFT JOIN comment_threads USING (comment_id)
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 = 'FanClub'
OR (comments.entity_type = 'Event' AND COALESCE(events.is_deleted, false) = false)
)
ORDER BY comments.created_at DESC
`
Expand Down
2 changes: 0 additions & 2 deletions api/dbv1/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,6 @@ func NewApiServer(config config.Config) *ApiServer {
g.Get("/fan_club/feed", app.v1FanClubFeed)
g.Get("/fan-club/feed", app.v1FanClubFeed)

g.Get("/events/:eventId/comments", app.v1EventComments)
g.Get("/events/:eventId/follow_state", app.v1EventFollowState)
g.Get("/events/:eventId/follow-state", app.v1EventFollowState)
g.Post("/events/:eventId/follow", app.requireAuthMiddleware, app.requireWriteScope, app.postV1EventFollow)
g.Delete("/events/:eventId/follow", app.requireAuthMiddleware, app.requireWriteScope, app.deleteV1EventFollow)

g.Get("/tracks/:trackId/comments", app.v1TrackComments)
g.Get("/tracks/:trackId/comment_count", app.v1TrackCommentCount)
g.Get("/tracks/:trackId/comment-count", app.v1TrackCommentCount)
Expand Down Expand Up @@ -614,7 +608,6 @@ func NewApiServer(config config.Config) *ApiServer {
// Events
g.Get("/events/unclaimed_id", app.v1EventsUnclaimedId)
g.Get("/events/unclaimed-id", app.v1EventsUnclaimedId)
g.Get("/events/remix-contests", app.v1EventsRemixContests)
g.Get("/events", app.v1Events)
g.Get("/events/all", app.v1Events)
g.Get("/events/entity", app.v1Events)
Expand Down
51 changes: 0 additions & 51 deletions api/swagger/swagger-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1194,57 +1194,6 @@ paths:
"500":
description: Server error
content: {}
/events/remix-contests:
get:
tags:
- events
summary: Get all remix contests
description:
Get remix contest events ordered with currently-active contests first
(by soonest-ending), followed by ended contests (most-recently-ended
first). Active contests are those whose end_date is null or in the
future.
operationId: Get Remix Contests
security:
- {}
- OAuth2:
- read
parameters:
- name: offset
in: query
description:
The number of items to skip. Useful for pagination (page number
* limit)
schema:
type: integer
- name: limit
in: query
description: The number of items to fetch
schema:
type: integer
- name: status
in: query
description: Filter contests by status
schema:
type: string
default: all
enum:
- active
- ended
- all
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/events_response"
"400":
description: Bad request
content: {}
"500":
description: Server error
content: {}
/events/unclaimed_id:
get:
tags:
Expand Down
8 changes: 4 additions & 4 deletions api/v1_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type GetCommentsParams struct {
}

type CreateCommentRequest struct {
EntityType string `json:"entityType" validate:"required,oneof=Track FanClub Event"`
EntityType string `json:"entityType" validate:"required,oneof=Track"`
EntityId int `json:"entityId" validate:"required,min=1"`
Body string `json:"body" validate:"required,max=500"`
CommentId *int `json:"commentId,omitempty" validate:"omitempty,min=1"`
Expand All @@ -33,19 +33,19 @@ type CreateCommentRequest struct {
}

type UpdateCommentRequest struct {
EntityType string `json:"entityType" validate:"required,oneof=Track FanClub Event"`
EntityType string `json:"entityType" validate:"required,oneof=Track"`
EntityId int `json:"entityId" validate:"required,min=1"`
Body string `json:"body" validate:"required,max=500"`
Mentions []int `json:"mentions,omitempty" validate:"omitempty,dive,min=1"`
}

type ReactCommentRequest struct {
EntityType string `json:"entityType" validate:"required,oneof=Track FanClub Event"`
EntityType string `json:"entityType" validate:"required,oneof=Track"`
EntityId int `json:"entityId" validate:"required,min=1"`
}

type PinCommentRequest struct {
EntityType string `json:"entityType" validate:"required,oneof=Track FanClub Event"`
EntityType string `json:"entityType" validate:"required,oneof=Track"`
EntityId int `json:"entityId" validate:"required,min=1"`
}

Expand Down
128 changes: 0 additions & 128 deletions api/v1_event_comments.go

This file was deleted.

Loading
Loading