fix: frontend with new backend schema

This commit is contained in:
2025-10-05 10:44:57 +01:00
parent 1fb9616aa7
commit 649cfe0b02
13 changed files with 111 additions and 142 deletions

View File

@@ -34,8 +34,8 @@ type ImageHandler struct {
}
type ImagesReturn struct {
UserImages []models.UserImageWithImage `json:"userImages"`
Lists []models.ListsWithImages `json:"lists"`
UserImages []models.UserImageWithImage
Stacks []models.ListsWithImages
}
func (h *ImageHandler) serveImage(w http.ResponseWriter, r *http.Request) {
@@ -89,7 +89,7 @@ func (h *ImageHandler) listImages(w http.ResponseWriter, r *http.Request) {
return
}
listsWithImages, err := h.userModel.ListWithImages(r.Context(), userId)
stacksWithImages, err := h.userModel.ListWithImages(r.Context(), userId)
if err != nil {
middleware.WriteErrorInternal(h.logger, "could not get lists with images", w)
return
@@ -97,7 +97,7 @@ func (h *ImageHandler) listImages(w http.ResponseWriter, r *http.Request) {
imagesReturn := ImagesReturn{
UserImages: images,
Lists: listsWithImages,
Stacks: stacksWithImages,
}
middleware.WriteJsonOrError(h.logger, imagesReturn, w)