diff --git a/app/api/data/companies-list/route.ts b/app/api/data/companies-list/route.ts index 33dc84e..e29d3fc 100644 --- a/app/api/data/companies-list/route.ts +++ b/app/api/data/companies-list/route.ts @@ -10,7 +10,11 @@ export async function GET() { const result = await postgresClient.query( `SELECT id, company_name FROM companies WHERE is_active = true AND is_deleted = false ORDER BY company_name ASC` ); - return NextResponse.json(result.rows); + const companies = result.rows.map((row) => ({ + id: Number(row.id), + company_name: row.company_name, + })); + return NextResponse.json(companies); } catch (error) { console.error('Error fetching companies list:', error); return NextResponse.json({ error: 'Failed to fetch companies list' }, { status: 500 });