From 07a7b16f9ac6b9122afc5362e330ae77d3354ce7 Mon Sep 17 00:00:00 2001 From: Steve White Date: Fri, 11 Oct 2024 10:40:27 -0500 Subject: [PATCH] Minor changes --- api_specification.md | 2 +- handlers.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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)