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:
RustamOper05 2024-01-17 14:10:24 +00:00
commit 0b7874e00e

View file

@ -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) {