add handlers method
This commit is contained in:
@@ -10,7 +10,13 @@ import (
|
||||
)
|
||||
|
||||
func (hc *handlersContext) getAllGames(c *gin.Context) {
|
||||
|
||||
users, err := hc.db.GetAllGames()
|
||||
if err != nil {
|
||||
utils.GetLoggerFromCtx(c).WithError(err).Error("error while getting games")
|
||||
utils.JSONErrorWithMessage(c.Writer, model.ErrInternalServer, "Error while getting games")
|
||||
return
|
||||
}
|
||||
utils.JSON(c.Writer, http.StatusOK, users)
|
||||
}
|
||||
|
||||
func (hc *handlersContext) getAGame(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user