fix(query): only active by org by primary domain (#5610)

This commit is contained in:
Silvan 2023-04-05 14:06:26 +02:00 committed by GitHub
parent d981f0d348
commit 8b5217c06d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,7 @@ func (q *Queries) OrgByPrimaryDomain(ctx context.Context, domain string) (_ *Org
query, args, err := stmt.Where(sq.Eq{
OrgColumnDomain.identifier(): domain,
OrgColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(),
OrgColumnState.identifier(): domain_pkg.OrgStateActive,
}).ToSql()
if err != nil {
return nil, errors.ThrowInternal(err, "QUERY-TYUCE", "Errors.Query.SQLStatement")