- Replace mobile placeholder with Expo Router app (tabs, playback, auth, library) - Move Convex backend to @otunes/convex for web and mobile reuse - Update web app imports and API routes to use shared package
21 lines
582 B
TypeScript
21 lines
582 B
TypeScript
import { api } from "@otunes/convex/_generated/api"
|
|
import type { Id } from "@otunes/convex/_generated/dataModel"
|
|
import { getConvexClient } from "@/lib/convex-server"
|
|
import { serveCoverFile } from "@/lib/serve-cover"
|
|
|
|
export async function GET(
|
|
_request: Request,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params
|
|
|
|
try {
|
|
const album = await getConvexClient().query(api.library.getAlbum, {
|
|
id: id as Id<"albums">,
|
|
})
|
|
return serveCoverFile(album?.cover)
|
|
} catch {
|
|
return new Response("Not found", { status: 404 })
|
|
}
|
|
}
|