From d38cfd697330310490fd560f17a3890962e9f54b Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 2 Feb 2026 15:04:05 +0100 Subject: [PATCH] import UserID was not read correctly --- backend/importer/handler.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/importer/handler.go b/backend/importer/handler.go index 83c6bf4..6b6421c 100644 --- a/backend/importer/handler.go +++ b/backend/importer/handler.go @@ -7,7 +7,6 @@ import ( "net/http" "os" "path/filepath" - "strconv" "strings" "github.com/gin-gonic/gin" @@ -59,13 +58,9 @@ func UploadFiles(c *gin.Context) { return } } - userIDStr := c.GetString("userID") - userID, err := strconv.Atoi(userIDStr) - if err != nil { - respondWithError(c, http.StatusInternalServerError, "Invalid user ID") - return - } - character, err3 := ImportVTTJSON(vttFileName, uint(userID)) + userID := c.GetUint("userID") + + character, err3 := ImportVTTJSON(vttFileName, userID) if err3 != nil { respondWithError(c, http.StatusInternalServerError, fmt.Sprintf("Failed to Import Character from file %s", err3.Error())) return