Render reply trees with permission-aware inline controls, and move hunt, profile, voting, submission, and hiding flows to post storage.
This commit is contained in:
@@ -157,6 +157,10 @@ func (p *Postgres) GetPostThread(ctx context.Context, rootID string) (*Post, err
|
||||
return GetPostThread(ctx, p.db, rootID)
|
||||
}
|
||||
|
||||
func (p *Postgres) GetPostThreadForViewer(ctx context.Context, rootID, viewerID string) (*Post, error) {
|
||||
return GetPostThreadForViewer(ctx, p.db, rootID, viewerID)
|
||||
}
|
||||
|
||||
func (p *Postgres) UpdatePost(ctx context.Context, post *Post) error {
|
||||
post.db = p.db
|
||||
return post.Update(ctx)
|
||||
@@ -166,6 +170,18 @@ func (p *Postgres) ListRootPosts(ctx context.Context, postDate, viewerID string)
|
||||
return ListRootPosts(ctx, p.db, postDate, viewerID)
|
||||
}
|
||||
|
||||
func (p *Postgres) ListRootPostsByAuthor(ctx context.Context, authorID string) ([]Post, error) {
|
||||
return ListRootPostsByAuthor(ctx, p.db, authorID)
|
||||
}
|
||||
|
||||
func (p *Postgres) ListRootPostsAnsweredBy(ctx context.Context, adminID string) ([]Post, error) {
|
||||
return ListRootPostsAnsweredBy(ctx, p.db, adminID)
|
||||
}
|
||||
|
||||
func (p *Postgres) SetRootPostState(ctx context.Context, id string, state PostState) error {
|
||||
return SetRootPostState(ctx, p.db, id, state)
|
||||
}
|
||||
|
||||
func (p *Postgres) VotePost(ctx context.Context, userID, postID string, value int) error {
|
||||
return SetPostVote(ctx, p.db, userID, postID, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user