Fix approval API URLs to use correct v1/approvals/decision endpoint

Revert to /api/v1/approvals (not /api/v1/release-orchestrator/approvals).
The gateway routes /api/v1/approvals/* → JobEngine, which registers the
/decision endpoint via ReleaseControlV2Endpoints.PostApprovalDecision().

The /api/v1/release-orchestrator/approvals/{id}/approve endpoints are
the classic routes from ApprovalEndpoints.cs — both work but the v1
/decision endpoint is the canonical one that supports approve/reject/
defer/escalate actions via a single body parameter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-03-27 18:14:22 +02:00
parent 868f94236b
commit 8a8e27d27d

View File

@@ -32,8 +32,8 @@ export interface ApprovalApi {
@Injectable()
export class ApprovalHttpClient implements ApprovalApi {
private readonly http = inject(HttpClient);
private readonly queueBaseUrl = '/api/v1/release-orchestrator/approvals';
private readonly detailBaseUrl = '/api/v1/release-orchestrator/approvals';
private readonly queueBaseUrl = '/api/v1/approvals';
private readonly detailBaseUrl = '/api/v1/approvals';
listApprovals(filter?: ApprovalFilter): Observable<ApprovalRequest[]> {
const params: Record<string, string> = {};
@@ -78,16 +78,20 @@ export class ApprovalHttpClient implements ApprovalApi {
}
approve(id: string, comment: string): Observable<ApprovalDetail> {
return this.http.post<any>(`${this.detailBaseUrl}/${id}/approve`, {
return this.http.post<any>(`${this.detailBaseUrl}/${id}/decision`, {
action: 'approve',
comment,
actor: 'ui-operator',
}).pipe(
map(row => this.mapV2ApprovalDetail(row))
);
}
reject(id: string, comment: string): Observable<ApprovalDetail> {
return this.http.post<any>(`${this.detailBaseUrl}/${id}/reject`, {
return this.http.post<any>(`${this.detailBaseUrl}/${id}/decision`, {
action: 'reject',
comment,
actor: 'ui-operator',
}).pipe(
map(row => this.mapV2ApprovalDetail(row))
);