mirror of
https://github.com/Snouzy/workout-cool.git
synced 2026-06-18 14:44:31 +00:00
14 lines
430 B
TypeScript
14 lines
430 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
import { getPublicPrograms } from "@/features/programs/actions/get-public-programs.action";
|
|
|
|
export async function GET() {
|
|
try {
|
|
const programs = await getPublicPrograms();
|
|
return NextResponse.json(programs);
|
|
} catch (error) {
|
|
console.error("Error fetching programs:", error);
|
|
return NextResponse.json({ error: "Failed to fetch programs" }, { status: 500 });
|
|
}
|
|
}
|