CountByUser returns the number of organizations the user is a member of.
(ctx context.Context, userID int64)
| 64 | |
| 65 | // CountByUser returns the number of organizations the user is a member of. |
| 66 | func (s *OrganizationsStore) CountByUser(ctx context.Context, userID int64) (int64, error) { |
| 67 | var count int64 |
| 68 | return count, s.db.WithContext(ctx).Model(&OrgUser{}).Where("uid = ?", userID).Count(&count).Error |
| 69 | } |
| 70 | |
| 71 | type Organization = User |
| 72 |