feat: add refund statuses
This commit is contained in:
@@ -448,3 +448,21 @@ func (m *usersModel) BuyPosts(ctx context.Context, userID, postID, price int64)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *usersModel) RevokePosts(ctx context.Context, userID, postID int64) error {
|
||||
tbl := table.UserPosts
|
||||
stmt := tbl.
|
||||
DELETE().
|
||||
WHERE(
|
||||
tbl.UserID.EQ(Int64(userID)).AND(
|
||||
tbl.PostID.EQ(Int64(postID)),
|
||||
),
|
||||
)
|
||||
m.log.Infof("sql: %s", stmt.DebugSql())
|
||||
|
||||
if _, err := stmt.ExecContext(ctx, db); err != nil {
|
||||
m.log.Errorf("error revoking user post: %v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user