File size: 726 Bytes
11c56f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 });
    }
}