Skip to content

Commit

Permalink
docs(blog): fix pointer type and add build steps (#4412)
Browse files Browse the repository at this point in the history
* update tutorial

* update tutorial

* fix comment
  • Loading branch information
chen4903 authored Nov 20, 2024
1 parent 0ff34e9 commit 11efdfb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/versioned_docs/version-v28/02-guide/04-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Add the `PostKey` and `PostCountKey` functions to the `x/blog/types/keys.go` fil

```go title="x/blog/types/keys.go"
// PostKey is used to uniquely identify posts within the system.
// It will be used as the beginning of the key for each post, followed bei their unique ID
// It will be used as the beginning of the key for each post, followed by their unique ID
PostKey = "Post/value/"

// This key will be used to keep track of the ID of the latest post added to the store.
Expand Down Expand Up @@ -220,7 +220,7 @@ ignite scaffold message delete-post id:uint
This command enables the deletion of posts by their ID.

2. **Delete Logic:**

Implement RemovePost in `x/blog/keeper/post.go` to delete posts from the store.

```go title="x/blog/keeper/post.go"
Expand Down Expand Up @@ -301,7 +301,7 @@ func (k Keeper) ShowPost(goCtx context.Context, req *types.QueryShowPostRequest)
return nil, sdkerrors.ErrKeyNotFound
}

return &types.QueryShowPostResponse{Post: post}, nil
return &types.QueryShowPostResponse{Post: &post}, nil
}
```

Expand Down Expand Up @@ -366,6 +366,18 @@ message QueryListPostResponse {
}
```

Build the blockchain:

```
ignite chain build
```

Start the blockchain:

```
ignite chain serve
```

**Interacting with the Blog**

1. **Create a Post:**
Expand Down

0 comments on commit 11efdfb

Please sign in to comment.