Skip to content

Commit

Permalink
LikePost -> s/usint64/string
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-hov committed Mar 14, 2024
1 parent d091f94 commit b6c8dd0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/gno.land/r/demo/postit/public.gno
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ func CreatePost(body, attachment string) string {
return strId
}

func LikePost(id uint64) {
func LikePost(id string) {
caller := std.PrevRealm().Addr()
user := getUserRefByAddress(caller)

post := getPostRef(id)
res, ok := posts.Get(id)
if !ok {
panic("post not found")
}
post := res.(*Post)

for _, un := range post.LikedBy {
if un == user.Username {
Expand Down

0 comments on commit b6c8dd0

Please sign in to comment.