backend: fixed wrong error codes

This commit is contained in:
Alex
2025-03-02 23:14:03 +01:00
parent 6937ab333c
commit ff3106b8be
9 changed files with 37 additions and 22 deletions

View File

@@ -316,7 +316,7 @@ func testCurrentUserHandler(t *testing.T, loginEmail string, loginCookie http.Co
setupCookie: func(req *http.Request) {},
expectedStatus: http.StatusUnauthorized,
expectedErrors: []map[string]string{
{"field": "general", "key": "server.error.no_auth_token"},
{"field": "server.general", "key": "server.error.no_auth_token"},
},
},
{
@@ -326,7 +326,7 @@ func testCurrentUserHandler(t *testing.T, loginEmail string, loginCookie http.Co
},
expectedStatus: http.StatusUnauthorized,
expectedErrors: []map[string]string{
{"field": "general", "key": "server.error.no_auth_token"},
{"field": "server.general", "key": "server.error.no_auth_token"},
},
},
}
@@ -507,7 +507,7 @@ func testUpdateUser(t *testing.T, loginCookie http.Cookie, adminCookie http.Cook
},
expectedStatus: http.StatusUnauthorized,
expectedErrors: []map[string]string{
{"field": "general", "key": "server.error.no_auth_token"},
{"field": "server.general", "key": "server.error.no_auth_token"},
},
},
{
@@ -948,7 +948,7 @@ func verifyMail(verificationURL string) error {
router := gin.New()
router.LoadHTMLGlob(filepath.Join(config.Templates.HTMLPath, "*"))
router.GET("/users/verify", Uc.VerifyMailHandler)
router.GET("api/users/verify", Uc.VerifyMailHandler)
wv := httptest.NewRecorder()
cv, _ := gin.CreateTestContext(wv)
var err error