From 3c26abdb01be0374ebcff0f8e60223cb695f82fa Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 13 Feb 2023 14:02:53 +0200 Subject: [PATCH] feat(sdbclient): update my_games to new standards --- sdbapi/handlers/mygames.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdbapi/handlers/mygames.go b/sdbapi/handlers/mygames.go index acdda70..610557a 100644 --- a/sdbapi/handlers/mygames.go +++ b/sdbapi/handlers/mygames.go @@ -1,6 +1,6 @@ /* * This file is part of sdbapi - * Copyright (C) 2022 Jonni Liljamo + * Copyright (C) 2023 Jonni Liljamo * * Licensed under GPL-3.0-only. * See LICENSE for licensing information. @@ -28,11 +28,10 @@ func MyGames(c *gin.Context) { games, err := db.GetGamesForUser(user.ID) if err != nil { - c.JSON(http.StatusBadRequest, gin.H{"error": err}) + c.JSON(http.StatusBadRequest, gin.H{"error": apierror.Placeholder}) c.Abort() return } - c.JSON(http.StatusOK, gin.H{"games": games}) + c.JSON(http.StatusOK, games) } - -- 2.44.1