mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Add activities page.
This commit is contained in:
@@ -62,3 +62,11 @@ func GetCommentsWithUser(username string, page, pageSize int) ([]model.Comment,
|
||||
totalPages := (int(total) + pageSize - 1) / pageSize
|
||||
return comments, totalPages, nil
|
||||
}
|
||||
|
||||
func GetCommentByID(commentID uint) (*model.Comment, error) {
|
||||
var comment model.Comment
|
||||
if err := db.Preload("User").Preload("Resource").First(&comment, commentID).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &comment, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user