cli icon indicating copy to clipboard operation
cli copied to clipboard

There seems to be a little bug in the documentation of ignite create blog comment

Open Frederic-Zhou opened this issue 2 years ago • 0 comments

at https://docs.ignite.com/guide/blog/comment-blog.html

After create first post ,the post.id=0 ,

because

      ...
       bz := store.Get(byteKey)
	// Return zero if the count value is not found (for example, it's the first post)
	if bz == nil {
		return 0
	}
      ...

at function AppendPost

then create first comment in the document: blogd tx blog create-comment 0 Uno "This is the first comment" --from alice

always return error

because at the function CreateComment

        ...
	// Check if the Post Exists for which a comment is being created
	if msg.PostID == 0 {
		return nil, sdkerrors.Wrapf(types.ErrID, "Post Blog Id does not exist for which comment with Blog Id %d was made", msg.PostID)
	}

       ...

Frederic-Zhou avatar May 25 '22 09:05 Frederic-Zhou