Skip to content

Commit

Permalink
fix unsubed sites showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
rupinr committed Oct 29, 2024
1 parent 03a1198 commit a6e4a81
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ func GetSubscriptionByEmail(email string) (entity.Subscription, error) {
var subscription entity.Subscription
db().
Preload("Sites").
Joins("SubscriptionSchedule").
Joins("User").
Joins("LEFT OUTER JOIN subscription_sites ON subscription_sites.subscription_id = subscriptions.id").
Joins("LEFT OUTER JOIN sites ON sites.id = subscription_sites.site_id").
Preload("User").
Preload("SubscriptionSchedule").
Joins("LEFT JOIN users ON users.id = subscriptions.user_id").
Joins("LEFT JOIN subscription_schedules ON subscription_schedules.id = subscriptions.subscription_schedule_id").
Find(&subscription, entity.Subscription{UserID: user.ID})

return subscription, result.Error
Expand Down

0 comments on commit a6e4a81

Please sign in to comment.