From ef8f4410c7989124384bded332ad60768639d07c Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Sun, 12 Jul 2026 17:59:03 +0530 Subject: [PATCH] fix: dead Add Note buttons and no-op row click in admin review pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - verification/[id].tsx: "Add Note" in the Reviewer Notes panel had no onClick — wired to the existing POST /api/admin/verifications/:id/notes endpoint. - approval/index.tsx: Decision Notes textarea was uncontrolled and its "Add Note" button was a no-op; there's no standalone notes endpoint for approval_requests, so the textarea is now bound to state and its value is sent as the rejection reason when the reviewer rejects (the only channel the backend currently supports). - support.tsx: removed a no-op onClick={() => {}} on the case row — the row isn't actually clickable, only the adjacent "View" link is (though that link's target route doesn't exist yet — flagged separately, out of scope here). --- src/routes/admin/approval/index.tsx | 7 ++++--- src/routes/admin/support.tsx | 2 +- src/routes/admin/verification/[id].tsx | 26 +++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/routes/admin/approval/index.tsx b/src/routes/admin/approval/index.tsx index 45d442d..fdbda2d 100644 --- a/src/routes/admin/approval/index.tsx +++ b/src/routes/admin/approval/index.tsx @@ -252,6 +252,7 @@ export default function ApprovalManagementPage() { const [filterMenuOpen, setFilterMenuOpen] = createSignal(false); const [error, setError] = createSignal(''); const [isActing, setIsActing] = createSignal(false); + const [decisionNote, setDecisionNote] = createSignal(''); const selectedDocuments = createMemo(() => { const row = viewingCase(); @@ -449,7 +450,7 @@ export default function ApprovalManagementPage() { }, credentials: 'include', body: action === 'reject' - ? JSON.stringify({ reason: 'Rejected by admin from approval management' }) + ? JSON.stringify({ reason: decisionNote().trim() || 'Rejected by admin from approval management' }) : JSON.stringify({}), }); if (!res.ok) { @@ -581,8 +582,8 @@ export default function ApprovalManagementPage() {

Decision Notes

-