Compare commits

..

No commits in common. "9ea200464d5930063ddf7c94b601f85f979b1438" and "fbc6c9ca204aa4fe72fcb3dde3461878a7ea9137" have entirely different histories.

3 changed files with 7 additions and 13 deletions

View File

@ -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 {

View File

@ -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
}

View File

@ -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 {