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:
@ -3,6 +3,7 @@ package view
|
||||
import "github.com/muety/wakapi/models"
|
||||
|
||||
type SummaryViewModel struct {
|
||||
Messages
|
||||
*models.Summary
|
||||
*models.SummaryParams
|
||||
User *models.User
|
||||
@ -10,18 +11,16 @@ type SummaryViewModel struct {
|
||||
EditorColors map[string]string
|
||||
LanguageColors map[string]string
|
||||
OSColors map[string]string
|
||||
Error string
|
||||
Success string
|
||||
ApiKey string
|
||||
RawQuery string
|
||||
}
|
||||
|
||||
func (s *SummaryViewModel) WithSuccess(m string) *SummaryViewModel {
|
||||
s.Success = m
|
||||
s.SetSuccess(m)
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *SummaryViewModel) WithError(m string) *SummaryViewModel {
|
||||
s.Error = m
|
||||
s.SetError(m)
|
||||
return s
|
||||
}
|
||||
|
Reference in New Issue
Block a user