fix(api): include song count in specials list
This commit is contained in:
@@ -6,6 +6,11 @@ const prisma = new PrismaClient();
|
|||||||
export async function GET() {
|
export async function GET() {
|
||||||
const specials = await prisma.special.findMany({
|
const specials = await prisma.special.findMany({
|
||||||
orderBy: { name: 'asc' },
|
orderBy: { name: 'asc' },
|
||||||
|
include: {
|
||||||
|
_count: {
|
||||||
|
select: { songs: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return NextResponse.json(specials);
|
return NextResponse.json(specials);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user