feat: slected after buy
This commit is contained in:
@@ -99,6 +99,11 @@ func (s *Service) BuyAvatar(ctx context.Context, userID int64, avatarID string)
|
||||
`INSERT INTO user_avatars (user_id, avatar_id) VALUES (?, ?)`, userID, avatarID); err != nil {
|
||||
return err
|
||||
}
|
||||
// خرید = مالکیت + انتخابِ خودکار.
|
||||
if _, err := tx.ExecContext(ctx,
|
||||
`UPDATE users SET selected_avatar = ? WHERE id = ?`, avatarID, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
return tx.Commit()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user