mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:47:32 +00:00
fix error
This commit is contained in:
@@ -224,9 +224,6 @@ func scanOrganization(ctx context.Context, querier database.Querier, builder *da
|
|||||||
|
|
||||||
organization := &domain.Organization{}
|
organization := &domain.Organization{}
|
||||||
if err := rows.(database.CollectableRows).CollectExactlyOneRow(organization); err != nil {
|
if err := rows.(database.CollectableRows).CollectExactlyOneRow(organization); err != nil {
|
||||||
if err.Error() == "no rows in result set" {
|
|
||||||
return nil, ErrResourceDoesNotExist
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,12 +238,6 @@ func scanOrganizations(ctx context.Context, querier database.Querier, builder *d
|
|||||||
|
|
||||||
organizations := []*domain.Organization{}
|
organizations := []*domain.Organization{}
|
||||||
if err := rows.(database.CollectableRows).Collect(&organizations); err != nil {
|
if err := rows.(database.CollectableRows).Collect(&organizations); err != nil {
|
||||||
// if no results returned, this is not a error
|
|
||||||
// it just means the organization was not found
|
|
||||||
// the caller should check if the returned organization is nil
|
|
||||||
if err.Error() == "no rows in result set" {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return organizations, nil
|
return organizations, nil
|
||||||
|
Reference in New Issue
Block a user