Minor changes
This commit is contained in:
parent
61f30677e8
commit
07a7b16f9a
|
@ -116,7 +116,7 @@ This document outlines the API endpoints for a simple inventory management syste
|
||||||
* **GET /items/{id}:**
|
* **GET /items/{id}:**
|
||||||
* Retrieves the item with the specified ID.
|
* Retrieves the item with the specified ID.
|
||||||
* Response: Item object
|
* Response: Item object
|
||||||
* **GET /items/{id}/items:**
|
* **GET /boxes/{id}/items:**
|
||||||
* Retrieves all items within the box with the specified ID.
|
* Retrieves all items within the box with the specified ID.
|
||||||
* Response: Array of Item objects
|
* Response: Array of Item objects
|
||||||
* **PUT /items/{id}:**
|
* **PUT /items/{id}:**
|
||||||
|
|
|
@ -241,7 +241,7 @@ func GetItemImageHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Log the error for debugging, but don't return an HTTP error
|
// Log the error for debugging, but don't return an HTTP error
|
||||||
fmt.Println("Error opening image.", err)
|
fmt.Println("Error opening image.", err)
|
||||||
item.ImagePath = "images/default.png"
|
item.ImagePath = "images/default.jpg"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer imageFile.Close()
|
defer imageFile.Close()
|
||||||
|
@ -250,7 +250,7 @@ func GetItemImageHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
imageData, err := io.ReadAll(imageFile)
|
imageData, err := io.ReadAll(imageFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error reading image")
|
fmt.Println("Error reading image")
|
||||||
item.ImagePath = "images/default.png"
|
item.ImagePath = "images/default.jpg"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
contentType := http.DetectContentType(imageData)
|
contentType := http.DetectContentType(imageData)
|
||||||
|
|
Loading…
Reference in New Issue