Merge pull request 'test_comments' (#13) from test_comments into master
Reviewed-on: https://codeberg.org/NaMe2te/Blog/pulls/13
This commit is contained in:
commit
0b7874e00e
1 changed files with 1 additions and 12 deletions
|
@ -99,18 +99,7 @@ func GetComment(commentId string) Comment {
|
|||
if comment == nil {
|
||||
panic("comment not found")
|
||||
}
|
||||
return comment.(Comment)
|
||||
}
|
||||
|
||||
func GetCommentInPost(commentId string, postId string) Comment {
|
||||
comments := GetByPostId(postId)
|
||||
for _, comment := range comments {
|
||||
if comment.id == commentId {
|
||||
return comment
|
||||
}
|
||||
}
|
||||
|
||||
panic("comment not found")
|
||||
return std.Deserialize(comment.([]byte)).(Comment)
|
||||
}
|
||||
|
||||
func RateComment(isLike bool, postId string, commentId string) {
|
||||
|
|
Loading…
Reference in a new issue