import { NextRequest } from "next/server";
import { proxyGet, proxyMutate } from "../../proxy";

export async function GET(req: NextRequest, { params }: { params: Promise<{ isrc: string }> }) {
  const { isrc } = await params;
  return proxyGet(`/songs/${encodeURIComponent(isrc)}`);
}

export async function PATCH(req: NextRequest, { params }: { params: Promise<{ isrc: string }> }) {
  const { isrc } = await params;
  return proxyMutate("PATCH", `/songs/${encodeURIComponent(isrc)}`, await req.json());
}
