mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 13:07:52 +00:00
fix: allow single parameter in org unique request (#3620)
This commit is contained in:
parent
a9f82529ab
commit
f70990709b
@ -2403,12 +2403,13 @@ This is an empty response
|
||||
|
||||
### IsOrgUniqueRequest
|
||||
if name or domain is already in use, org is not unique
|
||||
at least one argument has to be provided
|
||||
|
||||
|
||||
| Field | Type | Description | Validation |
|
||||
| ----- | ---- | ----------- | ----------- |
|
||||
| name | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
| domain | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
|
||||
| name | string | - | string.max_len: 200<br /> |
|
||||
| domain | string | - | string.max_len: 200<br /> |
|
||||
|
||||
|
||||
|
||||
|
@ -115,6 +115,9 @@ func (q *Queries) OrgByDomainGlobal(ctx context.Context, domain string) (*Org, e
|
||||
}
|
||||
|
||||
func (q *Queries) IsOrgUnique(ctx context.Context, name, domain string) (isUnique bool, err error) {
|
||||
if name == "" && domain == "" {
|
||||
return false, errors.ThrowInvalidArgument(nil, "QUERY-DGqfd", "Errors.Query.InvalidRequest")
|
||||
}
|
||||
query, scan := prepareOrgUniqueQuery()
|
||||
stmt, args, err := query.Where(
|
||||
sq.And{
|
||||
|
@ -2725,6 +2725,7 @@ message UpdateOIDCSettingsResponse {
|
||||
}
|
||||
|
||||
// if name or domain is already in use, org is not unique
|
||||
// at least one argument has to be provided
|
||||
message IsOrgUniqueRequest {
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
||||
json_schema: {
|
||||
@ -2734,18 +2735,16 @@ message IsOrgUniqueRequest {
|
||||
};
|
||||
|
||||
string name = 1 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
(validate.rules).string = {max_len: 200},
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"CAOS AG\"";
|
||||
min_length: 1;
|
||||
max_length: 200;
|
||||
}
|
||||
];
|
||||
string domain = 2 [
|
||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||
(validate.rules).string = {max_len: 200},
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"caos.ch\"";
|
||||
min_length: 1;
|
||||
max_length: 200;
|
||||
}
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user