mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
starting to resurect tests
This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
import { LocalCourse } from "@/models/local/localCourse";
|
||||
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
|
||||
import { withErrorHandling } from "@/services/withErrorHandling";
|
||||
|
||||
export const GET = async () =>
|
||||
await withErrorHandling(async () => {
|
||||
await withErrorHandling(async () => {
|
||||
const courses = await fileStorageService.getCourseNames();
|
||||
return Response.json(courses);
|
||||
});
|
||||
|
||||
export const POST = async (request: Request) =>
|
||||
await withErrorHandling(async () => {
|
||||
const newCourse: LocalCourse = await request.json();
|
||||
await fileStorageService.updateCourseSettings(
|
||||
newCourse.settings.name,
|
||||
newCourse.settings
|
||||
);
|
||||
return Response.json({});
|
||||
});
|
||||
|
||||
9
nextjs/src/app/api/courses/settings/route.ts
Normal file
9
nextjs/src/app/api/courses/settings/route.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
|
||||
import { withErrorHandling } from "@/services/withErrorHandling";
|
||||
|
||||
export const GET = async () =>
|
||||
await withErrorHandling(async () => {
|
||||
const settings = await fileStorageService.getAllCoursesSettings();
|
||||
|
||||
return Response.json(settings);
|
||||
});
|
||||
Reference in New Issue
Block a user