mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
moving data to be held by react query
This commit is contained in:
@@ -9,15 +9,6 @@ export async function PUT(
|
||||
console.log(updatedCourse);
|
||||
console.log(courseName);
|
||||
|
||||
await fileStorageService.saveCourseAsync(updatedCourse, previousCourse);
|
||||
// await fileStorageService.saveCourseAsync(updatedCourse, previousCourse);
|
||||
return Response.json({});
|
||||
}
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params: { courseName } }: { params: { courseName: string } }
|
||||
) {
|
||||
const courses = await fileStorageService.loadSavedCourses();
|
||||
const course = courses.find((c) => c.settings.name === courseName);
|
||||
return Response.json(course);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
|
||||
|
||||
export async function GET(
|
||||
_request: Request,
|
||||
{ params: { courseName } }: { params: { courseName: string } }
|
||||
) {
|
||||
const settings = await fileStorageService.getCourseSettings(courseName)
|
||||
return Response.json(settings);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
|
||||
|
||||
export async function GET() {
|
||||
const courses = await fileStorageService.loadSavedCourses();
|
||||
const courses = await fileStorageService.getCourseNames();
|
||||
|
||||
return Response.json(courses);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user