Spaces:
Sleeping
Sleeping
| import { NextResponse } from 'next/server'; | |
| import {BASE_URL} from "@/lib/config"; | |
| export async function GET() { | |
| try { | |
| const response = await fetch(`${BASE_URL}/api/get/music/store`); | |
| // Check if the response is ok | |
| if (!response.ok) { | |
| const errorData = await response.json(); | |
| return NextResponse.json({ error: errorData.error || 'Failed to fetch music store' }, { status: response.status }); | |
| } | |
| const data = await response.json(); | |
| return NextResponse.json(data); | |
| } catch (error) { | |
| console.error('Error fetching music store:', error); | |
| return NextResponse.json({ error: 'Failed to fetch music store' }, { status: 500 }); | |
| } | |
| } | |