Use relay and refacto public trust center

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-08-20 23:34:50 +02:00
parent 5db9b9f787
commit d31f611e63
19 changed files with 982 additions and 498 deletions

View File

@@ -102,6 +102,9 @@ func (s TrustCenterAccessService) Create(
err := existingAccess.LoadByTrustCenterIDAndEmail(ctx, tx, s.svc.scope, req.TrustCenterID, req.Email)
if err == nil {
if existingAccess.Active {
return fmt.Errorf("active trust center access already exists for this email")
}
if err := existingAccess.Delete(ctx, tx, s.svc.scope); err != nil {
return fmt.Errorf("cannot delete existing trust center access: %w", err)
}