From 6dea9def588202e2e514f49584ef4df5c75fc0c7 Mon Sep 17 00:00:00 2001 From: Leigh MacDonald Date: Sun, 12 Nov 2023 17:47:53 -0700 Subject: [PATCH] Fix null reports result --- Dockerfile | 2 +- Makefile | 2 +- docs/INSTALL.md | 2 +- frontend/package.json | 2 +- internal/app/http_api.go | 4 ++++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b10624dbb..b8fcd6ed2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ FROM alpine:latest LABEL maintainer="Leigh MacDonald " LABEL org.opencontainers.image.source="https://github.com/leighmacdonald/gbans" -LABEL org.opencontainers.image.version="v0.5.1" +LABEL org.opencontainers.image.version="v0.5.2" LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.description="Centralized community backend for Team Fortress 2" diff --git a/Makefile b/Makefile index 55d28a2fc..313ef8cb3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: all test clean build install frontend sourcemod BRANCH := $(shell git rev-parse --abbrev-ref HEAD) TAGGED_IMAGE = ghcr.io/leighmacdonald/gbans:$(BRANCH) -VERSION=v0.5.1 +VERSION=v0.5.2 GO_CMD=go GO_BUILD=$(GO_CMD) build GO_FLAGS = -trimpath -ldflags="-s -w -X github.com/leighmacdonald/gbans/internal/app.BuildVersion=$(VERSION)" diff --git a/docs/INSTALL.md b/docs/INSTALL.md index b16458817..c0467293b 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -58,7 +58,7 @@ sudo docker run -d --restart unless-stopped \ --dns=1.1.1.1 \ -v /home/ubuntu/gbans/gbans.yml:/app/gbans.yml:ro \ --name gbans \ - ghcr.io/leighmacdonald/gbans:v0.5.1 + ghcr.io/leighmacdonald/gbans:v0.5.2 ``` Substitute `master` for a specific tag if desired, and `/home/ubuntu/gbans/gbans.yml` with the location of your config. diff --git a/frontend/package.json b/frontend/package.json index 121298c25..58fa2729b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "gbans", - "version": "0.5.1", + "version": "0.5.2", "description": "gbans", "main": "src/index.tsx", "repository": "github.com/leighmacdonald/gbans", diff --git a/internal/app/http_api.go b/internal/app/http_api.go index 2b02e1968..4e6b2173c 100644 --- a/internal/app/http_api.go +++ b/internal/app/http_api.go @@ -2852,6 +2852,10 @@ func onAPIGetReports(app *App) gin.HandlerFunc { }) } + if userReports == nil { + userReports = []reportWithAuthor{} + } + ctx.JSON(http.StatusOK, LazyResult{ Count: count, Data: userReports,