Rework console pages and implement profile update

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-06 19:50:42 +04:00
parent 091210dee5
commit 3a459f1992
35 changed files with 2197 additions and 108 deletions

View File

@@ -65,14 +65,18 @@ func (p *MembershipProfile) AuthorizationAttributes(ctx context.Context, conn pg
q := `SELECT m.organization_id, mp.identity_id FROM iam_membership_profiles mp JOIN iam_memberships m ON mp.membership_id = m.id WHERE mp.id = $1 LIMIT 1;`
var organizationID gid.GID
if err := conn.QueryRow(ctx, q, p.ID).Scan(&organizationID); err != nil {
var identityID gid.GID
if err := conn.QueryRow(ctx, q, p.ID).Scan(&organizationID, &identityID); err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return nil, ErrResourceNotFound
}
return nil, fmt.Errorf("cannot query membership profile authorization attributes: %w", err)
}
return map[string]string{"organization_id": organizationID.String()}, nil
return map[string]string{
"organization_id": organizationID.String(),
"identity_id": identityID.String(),
}, nil
}
func (p *MembershipProfile) LoadByMembershipID(