|
|
- package database
-
- func GetAllSidebarLinks() ([]SidebarLink, error) {
- var (
- sidebar_links []SidebarLink
- e error
- )
-
- e = DB.Model(&SidebarLink{}).
- Find(&sidebar_links).
- Error
-
- return sidebar_links, e
- }
-
- func AddSidebarLink(name string, link string) error {
- var sidebar_link SidebarLink
-
- sidebar_link = SidebarLink{
- Name: name,
- Link: link,
- }
-
- return DB.Create(&sidebar_link).Error
- }
|