mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
22 lines
748 B
TypeScript
22 lines
748 B
TypeScript
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
|
|
import { withErrorHandling } from "@/services/withErrorHandling";
|
|
|
|
export const GET = async (
|
|
_request: Request,
|
|
{ params: { courseName } }: { params: { courseName: string } }
|
|
) =>
|
|
await withErrorHandling(async () => {
|
|
const settings = await fileStorageService.modules.getModuleNames(courseName);
|
|
return Response.json(settings);
|
|
});
|
|
|
|
export const POST = async (
|
|
request: Request,
|
|
{ params: { courseName } }: { params: { courseName: string } }
|
|
) =>
|
|
await withErrorHandling(async () => {
|
|
const { moduleName } = await request.json();
|
|
await fileStorageService.modules.createModule(courseName, moduleName);
|
|
return Response.json({});
|
|
});
|