diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml index cc36b53d..b4c14ed1 100644 --- a/.github/workflows/check-formatting.yml +++ b/.github/workflows/check-formatting.yml @@ -22,7 +22,7 @@ jobs: run: | cd backend && pip install . && - pip install black ruff pyright && + pip install black==24.1.1 ruff pyright && prisma generate - name: Setup Bun diff --git a/frontend/src/api/models/Body_upload_image_images_post.ts b/frontend/src/api/models/Body_upload_image_images_post.ts index 0001d0e5..21c665cf 100644 --- a/frontend/src/api/models/Body_upload_image_images_post.ts +++ b/frontend/src/api/models/Body_upload_image_images_post.ts @@ -3,5 +3,5 @@ /* tslint:disable */ /* eslint-disable */ export type Body_upload_image_images_post = { - image: Blob; + image: string; }; diff --git a/frontend/src/api/models/ValidationError.ts b/frontend/src/api/models/ValidationError.ts index aed8da76..fddc0ddc 100644 --- a/frontend/src/api/models/ValidationError.ts +++ b/frontend/src/api/models/ValidationError.ts @@ -6,4 +6,6 @@ export type ValidationError = { loc: Array; msg: string; type: string; + input?: any; + ctx?: Record; }; diff --git a/frontend/src/components/ImageUploadSection.tsx b/frontend/src/components/ImageUploadSection.tsx index 01642a38..7e043f93 100644 --- a/frontend/src/components/ImageUploadSection.tsx +++ b/frontend/src/components/ImageUploadSection.tsx @@ -22,18 +22,16 @@ export function ImageUploadSection({ console.log("File size:", file.size); console.log("File lastModified:", new Date(file.lastModified)); - // Verify file is readable const fileContent = await file.arrayBuffer(); console.log("File content length:", fileContent.byteLength); - // Create the form data object matching the generated type - const formData: Body_upload_image_images_post = { - image: file, - }; + // Temporary workaround: generated type says string, but backend expects a file upload + const formData = { + image: file as any, + } as Body_upload_image_images_post; console.log("Sending request..."); - // Use the generated ImagesService const result = await ImagesService.uploadImageImagesPost(formData); console.log("Upload successful:", result); @@ -50,7 +48,6 @@ export function ImageUploadSection({ console.error("Error body:", error.body); console.error("Error message:", error.message); - // Handle validation errors if (error.status === 422) { const detail = error.body?.detail || "Invalid image data"; throw new Error(`Validation error: ${JSON.stringify(detail)}`); @@ -60,7 +57,6 @@ export function ImageUploadSection({ throw new Error(error.body?.detail || "Bad request - invalid image"); } - // Handle API errors if (error.body?.detail) { throw new Error(error.body.detail); } diff --git a/frontend/src/util/UnpluggedBooks.ts b/frontend/src/util/UnpluggedBooks.ts index b46682f7..5f4f5698 100644 --- a/frontend/src/util/UnpluggedBooks.ts +++ b/frontend/src/util/UnpluggedBooks.ts @@ -125,4 +125,97 @@ export const unpluggedBooks = [ title: "Recipe for LLMs", link: "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/LLMs_Lesson_Plan.pdf", }, + { + author: "Jenna", + blurb: + 'Learn how games "think" by exploring if-statements and loops through videos, activities, and gameplay.', + bookCover: "/color_2.png", + category: "UNPLUGGED", + courses: [], + coverImage: + "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/controller.jpg", + id: 9999992, + owner: null, + ownerId: 16, + pages: [], + published: true, + readyForPublish: false, + tags: [], + title: "Intro to Game Logic", + link: "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/Intro_to_Game_Logic.pdf", + }, + { + author: "Martin", + blurb: + "Learn about algorithms and why clear, step-by-step instructions are important in programming.", + bookCover: "/color_1.png", + category: "UNPLUGGED", + courses: [], + coverImage: + "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/shoelace.png", + id: 9999991, + owner: null, + ownerId: 16, + pages: [], + published: true, + readyForPublish: false, + tags: [], + title: "Shoelace Algorithms", + link: "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/Shoelace_Algorithms.pdf", + }, + { + author: "Martin", + blurb: + "Learn about For Loops in programming and how they help make code shorter and more efficient.", + bookCover: "/color_7.png", + category: "UNPLUGGED", + courses: [], + coverImage: + "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/lego_for_loop.png", + id: 9999990, + owner: null, + ownerId: 16, + pages: [], + published: true, + readyForPublish: false, + tags: [], + title: "Lego For Loops", + link: "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/Lego_For_Loops.pdf", + }, + { + author: "Martin", + blurb: "Learn about how computers learn.", + bookCover: "/color_8.png", + category: "UNPLUGGED", + courses: [], + coverImage: + "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/supervised_learning.png", + id: 9999989, + owner: null, + ownerId: 16, + pages: [], + published: true, + readyForPublish: false, + tags: [], + title: "Supervised vs Unsupervised Learning", + link: "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/Supervised_v_Unsupervised_Learning.pdf", + }, + { + author: "Martin", + blurb: "Explore how AI makes decisions by playing Rock Paper Scissors.", + bookCover: "/color_3.png", + category: "UNPLUGGED", + courses: [], + coverImage: + "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/rock_paper_scissors.png", + id: 9999988, + owner: null, + ownerId: 16, + pages: [], + published: true, + readyForPublish: false, + tags: [], + title: "Rock Paper Scissors AI Activity", + link: "https://codekids-minio.endeavour.cs.vt.edu/codekids/unplugged/Rock_Paper_Scissors_AI_Activity.pdf", + }, ];