import { NextResponse } from 'next/server';

import { getInstitutionList } from '@/services/institutions';

export async function GET() {
  try {
    const institutions = await getInstitutionList();

    return NextResponse.json(institutions, { status: 200 });
  } catch (error) {
    console.error('Error fetching institutions:', error);
    return NextResponse.json({ error: 'Failed to fetch institutions' }, { status: 500 });
  }
}
