fix: id-s

This commit is contained in:
maksaid 2024-01-08 15:56:25 +03:00
parent 9f162e5363
commit 21d14fef3c

View file

@ -3,9 +3,9 @@ package Post
import ( import (
"strconv" "strconv"
guuid "github.com/google/uuid"
"github.com/nspcc-dev/neo-go/pkg/interop/native/std" "github.com/nspcc-dev/neo-go/pkg/interop/native/std"
"github.com/nspcc-dev/neo-go/pkg/interop/storage" "github.com/nspcc-dev/neo-go/pkg/interop/storage"
"github.com/rs/xid"
) )
type Post struct { type Post struct {
@ -40,7 +40,7 @@ func NewPost(authorId string, text string, postName string) {
likes: 0, likes: 0,
category: "none", category: "none",
postName: postName, postName: postName,
id: xid.New().String(), id: guuid.New().String(),
} }
storage.Put(ctx, post.id, std.Serialize(post)) storage.Put(ctx, post.id, std.Serialize(post))
updatePostIndex(authorId) updatePostIndex(authorId)