forked from baron/baron-sso
Apply stashed changes after rebase
This commit is contained in:
@@ -12,6 +12,7 @@ type ClientConsentRepository interface {
|
||||
Delete(ctx context.Context, subject, clientID string) error
|
||||
List(ctx context.Context, clientID string, limit, offset int) ([]domain.ClientConsentWithTenantInfo, int64, error)
|
||||
ListByTenant(ctx context.Context, clientID, tenantID string, limit, offset int) ([]domain.ClientConsentWithTenantInfo, int64, error)
|
||||
ListBySubject(ctx context.Context, subject string) ([]domain.ClientConsent, error)
|
||||
}
|
||||
|
||||
type clientConsentRepo struct {
|
||||
@@ -90,3 +91,12 @@ func (r *clientConsentRepo) ListByTenant(ctx context.Context, clientID, tenantID
|
||||
|
||||
return consents, total, err
|
||||
}
|
||||
|
||||
func (r *clientConsentRepo) ListBySubject(ctx context.Context, subject string) ([]domain.ClientConsent, error) {
|
||||
var consents []domain.ClientConsent
|
||||
err := r.db.WithContext(ctx).
|
||||
Where("subject = ?", subject).
|
||||
Order("updated_at DESC").
|
||||
Find(&consents).Error
|
||||
return consents, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user