fix comments
This commit is contained in:
parent
accc23b6b3
commit
259f1aa1e5
1 changed files with 16 additions and 3 deletions
|
@ -99,18 +99,31 @@ func GetComment(commentId string) Comment {
|
||||||
if comment == nil {
|
if comment == nil {
|
||||||
panic("comment not found")
|
panic("comment not found")
|
||||||
}
|
}
|
||||||
return comment.(Comment)
|
return std.Deserialize(comment.([]byte)).(Comment)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetCommentInPost(commentId string, postId string) Comment {
|
func GetCommentInPost(commentId string, postId string) Comment {
|
||||||
comments := GetByPostId(postId)
|
comments := GetByPostId(postId)
|
||||||
|
comment_t := Comment{}
|
||||||
|
flag := 0
|
||||||
|
runtime.Log("SIZEEEEEE " + std.Itoa10(len(comments)))
|
||||||
for _, comment := range comments {
|
for _, comment := range comments {
|
||||||
|
runtime.Log("COMMENT TOCHKA ID: " + comment.id + "--------COMMENT ID: " + commentId)
|
||||||
if comment.id == commentId {
|
if comment.id == commentId {
|
||||||
return comment
|
runtime.Log("REEEEETTTTTTTUUUURNNNNNn")
|
||||||
|
comment_t = comment
|
||||||
|
flag = 1
|
||||||
}
|
}
|
||||||
|
runtime.Log("FALSE FALSE")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runtime.Log("FLAAAAAAAAAAAAAAAAKKKK " + std.Itoa10(flag))
|
||||||
|
|
||||||
|
if flag == 0 {
|
||||||
panic("comment not found")
|
panic("comment not found")
|
||||||
|
} else {
|
||||||
|
return comment_t
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func RateComment(isLike bool, postId string, commentId string) {
|
func RateComment(isLike bool, postId string, commentId string) {
|
||||||
|
|
Loading…
Reference in a new issue