fix active subscription visibility after updates

This commit is contained in:
ShukeBta
2026-06-27 15:14:43 +08:00
parent f88b833cbc
commit c8fe2f6516
5 changed files with 149 additions and 9 deletions
@@ -21,7 +21,11 @@ func (r *SubscriptionRepository) Create(ctx context.Context, s *model.Subscripti
// intentionally excluded from scheduler polling and the active management list.
func (r *SubscriptionRepository) List(ctx context.Context) ([]model.Subscription, error) {
var rows []model.Subscription
err := r.db.WithContext(ctx).Where("archived_at IS NULL").Order("created_at desc").Find(&rows).Error
err := r.db.WithContext(ctx).Unscoped().
Where("archived_at IS NULL").
Where("deleted_at IS NULL OR enabled = ?", true).
Order("created_at desc").
Find(&rows).Error
return rows, err
}