workign on api errors

This commit is contained in:
2024-09-09 19:52:47 -06:00
parent e1f1401592
commit 945253c208
12 changed files with 217 additions and 230 deletions

View File

@@ -1,9 +1,11 @@
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
import { withErrorHandling } from "@/services/withErrorHandling";
export async function GET(
export const GET = async (
_request: Request,
{ params: { courseName } }: { params: { courseName: string } }
) {
const settings = await fileStorageService.getModuleNames(courseName)
return Response.json(settings);
}
) =>
await withErrorHandling(async () => {
const settings = await fileStorageService.getModuleNames(courseName);
return Response.json(settings);
});