Problem
In Vouch.tsx (lines 179-183), the handleDecline function uses setTimeout(() => r(), 600) to simulate declining a vouch request. No API call is made. The request visually disappears from the UI after 600ms but reappears on page refresh because the decline was never persisted.
User impact: Mentors believe they have declined vouch requests, but the requests keep reappearing. This creates confusion and undermines trust in the platform.
Root Cause
The decline action was stubbed during initial development. The API endpoint POST /vouching/decline or equivalent exists (vouching.controller.ts) but was never wired to the frontend.
What To Build
- Add
declineVouch(requestId) method to vouching.service.ts
- Replace the
setTimeout + fake decline in Vouch.tsx with real API call
- Add loading spinner on the decline button while request is in flight
- Add error toast if decline fails
- Remove the declined request from local state on success
Files To Touch
src/pages/Vouch.tsx — lines 179-183 replace fake decline
src/services/vouching.service.ts — add declineVouch method
Acceptance Criteria
Mandatory Checks
Problem
In Vouch.tsx (lines 179-183), the
handleDeclinefunction usessetTimeout(() => r(), 600)to simulate declining a vouch request. No API call is made. The request visually disappears from the UI after 600ms but reappears on page refresh because the decline was never persisted.User impact: Mentors believe they have declined vouch requests, but the requests keep reappearing. This creates confusion and undermines trust in the platform.
Root Cause
The decline action was stubbed during initial development. The API endpoint
POST /vouching/declineor equivalent exists (vouching.controller.ts) but was never wired to the frontend.What To Build
declineVouch(requestId)method tovouching.service.tssetTimeout+ fake decline in Vouch.tsx with real API callFiles To Touch
src/pages/Vouch.tsx— lines 179-183 replace fake declinesrc/services/vouching.service.ts— add declineVouch methodAcceptance Criteria
setTimeoutused for simulating API calls anywhereMandatory Checks