import UserID was not read correctly
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -59,13 +58,9 @@ func UploadFiles(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userIDStr := c.GetString("userID")
|
userID := c.GetUint("userID")
|
||||||
userID, err := strconv.Atoi(userIDStr)
|
|
||||||
if err != nil {
|
character, err3 := ImportVTTJSON(vttFileName, userID)
|
||||||
respondWithError(c, http.StatusInternalServerError, "Invalid user ID")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
character, err3 := ImportVTTJSON(vttFileName, uint(userID))
|
|
||||||
if err3 != nil {
|
if err3 != nil {
|
||||||
respondWithError(c, http.StatusInternalServerError, fmt.Sprintf("Failed to Import Character from file %s", err3.Error()))
|
respondWithError(c, http.StatusInternalServerError, fmt.Sprintf("Failed to Import Character from file %s", err3.Error()))
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user