Skip to content

Commit

Permalink
updated blog post fetching api in different realms
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn committed Nov 27, 2023
1 parent 007f110 commit 22305c3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/gno.land/p/demo/blog/types.gno
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Post struct {
}

type Comment struct {
ID int
ID seqid.ID
Post *Post
CreatedAt time.Time
Author std.Address
Expand Down
1 change: 1 addition & 0 deletions examples/gno.land/p/demo/blog/util.gno
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package blog

import (
"sort"
"strings"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/gnoland/blog/admin.gno
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func ModEditPost(slug, title, body, tags string) {
assertIsModerator()

tagList := strings.Split(tags, ",")
err := b.GetPost(slug).Update(title, body, tagList)
err := b.Posts.GetPostBySlug(slug).Update(title, body, tagList)
checkErr(err)
}

Expand All @@ -69,7 +69,7 @@ func ModDelCommenter(addr std.Address) {
func ModDelComment(slug string, index int) {
assertIsModerator()

err := b.GetPost(slug).DeleteComment(index)
err := b.Posts.GetPostBySlug(slug).DeleteComment(index)
checkErr(err)
}

Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/gnoland/blog/gnoblog.gno
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func AddComment(postSlug, comment string) {
assertNotInPause()

caller := std.GetOrigCaller()
err := b.GetPost(postSlug).AddComment(caller, comment)
err := b.Posts.GetPostBySlug(postSlug).AddComment(caller, comment)
checkErr(err)
}

Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/gnoland/pages/admin.gno
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func ModEditPost(slug, title, body, tags string) {
assertIsModerator()

tagList := strings.Split(tags, ",")
err := b.GetPost(slug).Update(title, body, tagList)
err := b.Posts.GetPostBySlug(slug).Update(title, body, tagList)
checkErr(err)
}

Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/manfred/present/admin.gno
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func ModEditPost(slug, title, body, tags string) {
assertIsModerator()

tagList := strings.Split(tags, ",")
err := b.GetPost(slug).Update(title, body, tagList)
err := b.Posts.GetPostBySlug(slug).Update(title, body, tagList)
checkErr(err)
}

Expand Down

0 comments on commit 22305c3

Please sign in to comment.