diff --git a/Comment/comment.go b/Comment/comment.go index 218372d..1ebf578 100755 --- a/Comment/comment.go +++ b/Comment/comment.go @@ -99,18 +99,31 @@ func GetComment(commentId string) Comment { if comment == nil { panic("comment not found") } - return comment.(Comment) + return std.Deserialize(comment.([]byte)).(Comment) } func GetCommentInPost(commentId string, postId string) Comment { comments := GetByPostId(postId) + comment_t := Comment{} + flag := 0 + runtime.Log("SIZEEEEEE " + std.Itoa10(len(comments))) for _, comment := range comments { + runtime.Log("COMMENT TOCHKA ID: " + comment.id + "--------COMMENT ID: " + commentId) if comment.id == commentId { - return comment + runtime.Log("REEEEETTTTTTTUUUURNNNNNn") + comment_t = comment + flag = 1 } + runtime.Log("FALSE FALSE") } - panic("comment not found") + runtime.Log("FLAAAAAAAAAAAAAAAAKKKK " + std.Itoa10(flag)) + + if flag == 0 { + panic("comment not found") + } else { + return comment_t + } } func RateComment(isLike bool, postId string, commentId string) {