From f66a37221cad1424527d588ea3858f508373f722 Mon Sep 17 00:00:00 2001 From: Bartosz Szar Date: Mon, 4 Nov 2024 21:50:55 +0100 Subject: [PATCH] fix investment status preloading when fetching investor --- controllers/investorsController.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/investorsController.go b/controllers/investorsController.go index 170a812..00d1417 100644 --- a/controllers/investorsController.go +++ b/controllers/investorsController.go @@ -121,7 +121,7 @@ func GetSingleInvestor(c *gin.Context) { user, _ := c.Get("user") var investor models.Investor - result := initializers.DB.Where("user_id = ?", user.(models.User).ID).Preload("Address").Preload("Locations").First(&investor, c.Param("id")) + result := initializers.DB.Where("user_id = ?", user.(models.User).ID).Preload("Address").Preload("Locations").Preload("Locations.Status").First(&investor, c.Param("id")) if result.Error != nil { c.JSON(http.StatusInternalServerError, gin.H{