From e7bed8124c99a4872e4954fa938e4000a8361b93 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 1 Feb 2023 14:31:40 -0300 Subject: [PATCH] don't join the other tables, let the client ask the API in the other endpoints --- backend/controllers/game.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/controllers/game.go b/backend/controllers/game.go index 2c01441..e2a4aa8 100644 --- a/backend/controllers/game.go +++ b/backend/controllers/game.go @@ -58,7 +58,7 @@ func ListGames(writer http.ResponseWriter, request *http.Request, params httprou var games []models.Game - result := gdb.Model(&models.Game{}).Order("ID asc").Joins("Player").Joins("Level").Joins("OS").Joins("GodotVersion").Find(&games) + result := gdb.Model(&models.Game{}).Order("ID asc").Find(&games) if result.Error != nil { utils.JSONErrorOutput(writer, http.StatusBadRequest, result.Error.Error()) return @@ -76,7 +76,7 @@ func GetGame(writer http.ResponseWriter, request *http.Request, params httproute var game models.Game - result := gdb.Model(&models.Game{}).Order("ID asc").Joins("Player").Joins("Level").Joins("OS").Find(&game, params.ByName("id")) + result := gdb.Model(&models.Game{}).Order("ID asc").Find(&game, params.ByName("id")) if result.Error != nil { utils.JSONErrorOutput(writer, http.StatusBadRequest, result.Error.Error()) return