Added easier setter funcs for flash messages.

This commit is contained in:
mikestefanello 2021-12-03 16:44:04 -05:00
parent fc1d3cdc33
commit d40244b3d1
4 changed files with 30 additions and 14 deletions

View file

@ -20,7 +20,7 @@ func (a *Contact) Get(c echo.Context) error {
}
func (a *Contact) Post(c echo.Context) error {
msg.Set(c, msg.Success, "Thank you for contacting us!")
msg.Set(c, msg.Info, "We will respond to you shortly.")
msg.Success(c, "Thank you for contacting us!")
msg.Info(c, "We will respond to you shortly.")
return a.Redirect(c, "home")
}

View file

@ -20,6 +20,6 @@ func (l *Login) Get(c echo.Context) error {
}
func (l *Login) Post(c echo.Context) error {
msg.Set(c, msg.Danger, "Invalid credentials. Please try again.")
msg.Danger(c, "Invalid credentials. Please try again.")
return l.Get(c)
}

View file

@ -20,6 +20,6 @@ func (r *Register) Get(c echo.Context) error {
}
func (r *Register) Post(c echo.Context) error {
msg.Set(c, msg.Danger, "Registration is currently disabled.")
msg.Danger(c, "Registration is currently disabled.")
return r.Get(c)
}