mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-20 03:48:47 +00:00
feat: add project creator role on register user (#222)
* feat: add project creator role on register user * fix: better error message * fix: tests
This commit is contained in:
@@ -62,7 +62,7 @@ func precondtion(tx *sql.Tx, aggregate *models.Aggregate) error {
|
||||
}
|
||||
err = aggregate.Precondition.Validation(events...)
|
||||
if err != nil {
|
||||
return caos_errs.ThrowPreconditionFailed(err, "SQL-s6hqU", "validation failed")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ func Test_precondtion(t *testing.T) {
|
||||
expectBegin(nil).expectFilterEventsLimit(5, 0),
|
||||
},
|
||||
args: args{
|
||||
aggregate: aggregateWithPrecondition(&models.Aggregate{}, models.NewSearchQuery().SetLimit(5), validationFunc(errors.CreateCaosError(nil, "SQL-LBIKm", "err"))),
|
||||
aggregate: aggregateWithPrecondition(&models.Aggregate{}, models.NewSearchQuery().SetLimit(5), validationFunc(errors.ThrowPreconditionFailed(nil, "SQL-LBIKm", "err"))),
|
||||
},
|
||||
isErr: errors.IsPreconditionFailed,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user