Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/models/Body_upload_image_images_post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/* tslint:disable */
/* eslint-disable */
export type Body_upload_image_images_post = {
image: Blob;
image: string;
};
2 changes: 2 additions & 0 deletions frontend/src/api/models/ValidationError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export type ValidationError = {
loc: Array<string | number>;
msg: string;
type: string;
input?: any;
ctx?: Record<string, any>;
};
12 changes: 4 additions & 8 deletions frontend/src/components/ImageUploadSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)}`);
Expand All @@ -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);
}
Expand Down
93 changes: 93 additions & 0 deletions frontend/src/util/UnpluggedBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
];
Loading