clean: made pageError struct type

This commit is contained in:
Florian Sylvain
2023-08-12 22:38:01 +02:00
parent e575062209
commit 5c61796313
3 changed files with 14 additions and 8 deletions
+6 -5
View File
@@ -11,15 +11,16 @@ import (
const LoginRoute = "/login"
type LoginPage struct {
IsError bool `json:"isError"`
Error string `json:"error"`
Username string `json:"username"`
PageError *PageError `json:"error"`
Username string `json:"username"`
}
func NewLoginPage(error string, username string) *LoginPage {
return &LoginPage{
IsError: strings.Compare(error, "") != 0,
Error: error,
PageError: &PageError{
IsError: strings.Compare(error, "") != 0,
Message: error,
},
Username: username,
}
}