Update trust center handler

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-08 20:33:31 +02:00
parent 5c1531bd2b
commit 65b7d90d61
9 changed files with 418 additions and 85 deletions

View File

@@ -89,6 +89,31 @@ func (s TrustCenterService) Get(
return trustCenter, file, nil
}
func (s TrustCenterService) GetByOrganizationID(
ctx context.Context,
organizationID gid.GID,
) (*coredata.TrustCenter, error) {
trustCenter := &coredata.TrustCenter{}
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
err := trustCenter.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID)
if err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
}
return nil
},
)
if err != nil {
return nil, err
}
return trustCenter, nil
}
func (s TrustCenterService) GenerateNDAFileURL(
ctx context.Context,
trustCenterID gid.GID,