fix(awooop): authenticate approval decisions
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / tests (push) Successful in 1m3s
CD Pipeline / build-and-deploy (push) Successful in 3m28s
CD Pipeline / post-deploy-checks (push) Successful in 1m25s

This commit is contained in:
OG T
2026-05-06 13:05:51 +08:00
parent e6eae5cdc4
commit c696b99ccf
9 changed files with 294 additions and 6 deletions

View File

@@ -281,6 +281,11 @@ export default function ApprovalDecisionPage({
}, [fetchRun]);
const handleApprove = async () => {
if (!run?.project_id || run.project_id === "--") {
setActionError("缺少 project_id無法送出審批決策");
setShowApproveDialog(false);
return;
}
setActionLoading(true);
setActionError(null);
try {
@@ -290,8 +295,8 @@ export default function ApprovalDecisionPage({
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
project_id: run.project_id,
decision: "approve",
approver_id: "operator",
reason: null,
}),
}
@@ -309,6 +314,11 @@ export default function ApprovalDecisionPage({
};
const handleReject = async (reason: string) => {
if (!run?.project_id || run.project_id === "--") {
setActionError("缺少 project_id無法送出審批決策");
setShowRejectDialog(false);
return;
}
setActionLoading(true);
setActionError(null);
try {
@@ -318,8 +328,8 @@ export default function ApprovalDecisionPage({
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
project_id: run.project_id,
decision: "reject",
approver_id: "operator",
reason,
}),
}