DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

2a05f660b58f1c9a0343c4327f4e18a616a6eebc — Jonni Liljamo 1 year, 10 months ago e5fa7fd
fix(sdbapi): patchgamestate check for guest
1 files changed, 4 insertions(+), 0 deletions(-)

M sdbapi/handlers/patchgamestate.go
M sdbapi/handlers/patchgamestate.go => sdbapi/handlers/patchgamestate.go +4 -0
@@ 52,6 52,10 @@ func PatchGameState(c *gin.Context) {
		if patchedGame.State != models.GAMESTATE_INPROGRESS && patchedGame.State != models.GAMESTATE_CANCELLED {
			failed = true
		}
		// do we have a guest?
		if game.GuestID == "" {
			failed = true
		}
	} else if game.State == models.GAMESTATE_INPROGRESS {
		// allow only FINISHED
		if patchedGame.State != models.GAMESTATE_FINISHED {