Minor changes

This commit is contained in:
Steve White 2024-10-11 10:40:27 -05:00
parent 61f30677e8
commit 07a7b16f9a
2 changed files with 3 additions and 3 deletions

View File

@ -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}:**

View File

@ -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)