mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
refactor: flash messages framework (resolve #446)
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type LeaderboardViewModel struct {
|
||||
Messages
|
||||
User *models.User
|
||||
By string
|
||||
Key string
|
||||
@ -16,17 +17,15 @@ type LeaderboardViewModel struct {
|
||||
UserLanguages map[string][]string
|
||||
ApiKey string
|
||||
PageParams *utils.PageParams
|
||||
Success string
|
||||
Error string
|
||||
}
|
||||
|
||||
func (s *LeaderboardViewModel) WithSuccess(m string) *LeaderboardViewModel {
|
||||
s.Success = m
|
||||
s.SetSuccess(m)
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *LeaderboardViewModel) WithError(m string) *LeaderboardViewModel {
|
||||
s.Error = m
|
||||
s.SetError(m)
|
||||
return s
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user