import { NextResponse } from "next/server"; export async function GET() { const cards = [ { id: "1", bank: "ADCB", minSalary: 5000, annualFee: "Free for Life", offers: ["Buy one get one at VOX", "Talabat free delivery"], features: ["Free for Life", "Welcome Bonus"], image: "/images/adcb-card.png", }, { id: "2", bank: "RAKBANK", minSalary: 8000, annualFee: "AED 365 per year", offers: ["5% cashback on groceries"], features: ["Cashback", "Dining Discounts"], image: "/images/rakbank-card.png", }, { id: "3", bank: "Dubai Islamic Bank", minSalary: 6000, annualFee: "Free for Life", offers: ["10% cashback on dining"], features: ["Cashback", "Dining Discounts"], image: "/images/dib-card.png", }, ]; return NextResponse.json(cards); } // import { NextResponse } from 'next/server'; // import { pool } from '@/backend/utils/db'; // your MySQL connection // export async function GET() { // try { // const [rows] = await pool.query(` // SELECT cc.idcreditcards, // cc.creditcardsname, // cc.MinimumSalary, // cc.AnnualFee, // cc.creditcardsimagename // FROM creditcards cc // INNER JOIN creditcardstypes ct ON ct.idcreditcards = cc.idcreditcards // WHERE ct.idcreditcards = ? // `, [128]); // return NextResponse.json(rows); // } catch (error) { // return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 }); // } // }