Progress on account and dashboard save/load

This commit is contained in:
Torkel Ödegaard
2014-11-20 15:19:44 +01:00
parent 00b4d233cc
commit 4eefa73441
9 changed files with 68 additions and 8 deletions
+11 -1
View File
@@ -47,8 +47,18 @@ func SearchQuery(query string, accountId int64) ([]*models.SearchResult, error)
sess := x.Limit(100, 0).Where("account_id=?", accountId)
sess.Table("Dashboard")
var results []*models.SearchResult
results := make([]*models.SearchResult, 0)
err := sess.Find(&results)
return results, err
}
func DeleteDashboard(slug string, accountId int64) error {
sess := x.NewSession()
defer sess.Close()
rawSql := "DELETE FROM Dashboard WHERE account_id=? and slug=?"
_, err := sess.Exec(rawSql, accountId, slug)
return err
}