diff --git a/backend/app/models/posts.go b/backend/app/models/posts.go index c3d3d0b..3c32e27 100644 --- a/backend/app/models/posts.go +++ b/backend/app/models/posts.go @@ -228,8 +228,11 @@ func (m *postsModel) SendTo(ctx context.Context, postId, userId int64) error { // add record to user_posts tbl := table.UserPosts stmt := tbl.INSERT(tbl.MutableColumns).MODEL(model.UserPosts{ - UserID: userId, - PostID: postId, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + UserID: userId, + PostID: postId, + Price: -1, }) m.log.Infof("sql: %s", stmt.DebugSql()) if _, err := stmt.ExecContext(ctx, db); err != nil {