Implemented adding/renaming of areas and sections

This commit is contained in:
Magnus Åhall 2024-05-01 21:02:45 +02:00
parent d935eb282b
commit 62405c3138
13 changed files with 175 additions and 13 deletions

View file

@ -21,3 +21,12 @@ func (s *Section) SortedTriggers() []Trigger {
return s.Triggers
}
func SectionCreate(areaID int, name string) (err error) {// {{{
_, err = service.Db.Conn.Exec(`INSERT INTO section(area_id, name) VALUES($1, $2)`, areaID, name)
return
}// }}}
func SectionRename(id int, name string) (err error) {// {{{
_, err = service.Db.Conn.Exec(`UPDATE section SET name=$2 WHERE id=$1`, id, name)
return
}// }}}