import { getChapterApi } from "@/lib/server/app-services";

export async function GET(
  _request: Request,
  context: { params: Promise<{ bookId: string }> },
) {
  const { bookId } = await context.params;
  return getChapterApi().list(bookId);
}

export async function PUT(
  request: Request,
  context: { params: Promise<{ bookId: string }> },
) {
  const { bookId } = await context.params;
  return getChapterApi().save(request, bookId);
}
