diff --git a/api_specification.md b/api_specification.md index 8cf9a6a..d1178b9 100644 --- a/api_specification.md +++ b/api_specification.md @@ -116,7 +116,7 @@ This document outlines the API endpoints for a simple inventory management syste * **GET /items/{id}:** * Retrieves the item with the specified ID. * Response: Item object -* **GET /items/{id}/items:** +* **GET /boxes/{id}/items:** * Retrieves all items within the box with the specified ID. * Response: Array of Item objects * **PUT /items/{id}:** diff --git a/handlers.go b/handlers.go index e84636a..28892d2 100644 --- a/handlers.go +++ b/handlers.go @@ -241,7 +241,7 @@ func GetItemImageHandler(w http.ResponseWriter, r *http.Request) { if err != nil { // Log the error for debugging, but don't return an HTTP error fmt.Println("Error opening image.", err) - item.ImagePath = "images/default.png" + item.ImagePath = "images/default.jpg" return } defer imageFile.Close() @@ -250,7 +250,7 @@ func GetItemImageHandler(w http.ResponseWriter, r *http.Request) { imageData, err := io.ReadAll(imageFile) if err != nil { fmt.Println("Error reading image") - item.ImagePath = "images/default.png" + item.ImagePath = "images/default.jpg" return } contentType := http.DetectContentType(imageData)