Compare commits
No commits in common. "8a1fef487a150760b19c5ad251fe6c0765a70a11" and "fbc6c9ca204aa4fe72fcb3dde3461878a7ea9137" have entirely different histories.
8a1fef487a
...
fbc6c9ca20
|
|
@ -80,7 +80,7 @@ func GetAllGroups() ([]Group, error) {
|
|||
}
|
||||
|
||||
func CreateGroup(name string, reference string) (*Group, error) {
|
||||
name = normalize.Trim(name)
|
||||
name = normalize.Name(name)
|
||||
stmt := "INSERT INTO [group] (name, reference) VALUES (?, ?)"
|
||||
result, err := database.Exec(stmt, name, reference)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ func (res *Response) Write(w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
if res.SeeOther != "" {
|
||||
http.Redirect(w, r, res.SeeOther, http.StatusSeeOther)
|
||||
if res.Session != nil {
|
||||
flash := res.Session.FlashPeek()
|
||||
if flash != nil {
|
||||
err := json.NewEncoder(w).Encode(flash)
|
||||
|
|
@ -37,7 +36,6 @@ func (res *Response) Write(w http.ResponseWriter, r *http.Request) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,11 +18,7 @@ func (s *Session) FlashGet() any {
|
|||
}
|
||||
|
||||
func (s *Session) FlashPeek() any {
|
||||
flash, ok := s.inner.Values["_flash"]
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
list := flash.([]any)
|
||||
list, _ := s.inner.Values["_flash"].([]any)
|
||||
if len(list) < 1 {
|
||||
return nil
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue