module.exports = router; api.ts const API_BASE = 'http://localhost:5000/api'; export interface BlockCardRequest 'stolen'
// 1. Create block request record const blockReq = await client.query( `INSERT INTO card_block_requests (card_id, request_reason, description, status) VALUES ($1, $2, $3, 'pending') RETURNING *`, [cardId, reason, description] );
.warning margin-top: 1.2rem; font-size: 0.8rem; color: #e11d48; background: #fff1f2; padding: 8px; border-radius: 8px; text-align: center;
button width: 100%; padding: 12px; background-color: #dc2626; color: white; border: none; border-radius: 40px; font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.2s;
if (response.data.status === 'SUCCESS') return success: true, referenceId: response.data.referenceId ; else catch (error) console.error('HDFC API error:', error.message); return ;
button:hover:not(:disabled) background-color: #b91c1c;
await client.query('COMMIT'); return blockReq.rows[0]; catch (err) await client.query('ROLLBACK'); throw err; finally client.release();
export async function blockHDFCCard(data: BlockCardRequest): Promise< success: boolean; referenceId?: string; error?: string > const response = await fetch( $API_BASE/cards/hdfc/block , method: 'POST', headers: 'Content-Type': 'application/json' , body: JSON.stringify(data), ); return response.json();