1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-04 21:15:24 +02:00

Provider sample data for Cloud onboarding

This commit is contained in:
sauls8t 2019-06-29 15:37:49 +01:00
parent 201d2a339c
commit 69077ce419
7 changed files with 1201 additions and 1100 deletions

View file

@ -22,7 +22,7 @@ type Store struct {
}
// ContentCounts returns the number of spaces and documents.
func (s Store) ContentCounts() (spaces, docs int) {
func (s Store) ContentCounts(orgID string) (spaces, docs int) {
// By default we assume there is content in case of error condition.
spaces = 10
docs = 10
@ -30,16 +30,20 @@ func (s Store) ContentCounts() (spaces, docs int) {
var m int
var err error
row := s.Runtime.Db.QueryRow("SELECT COUNT(*) FROM dmz_space")
row := s.Runtime.Db.QueryRow(s.Bind("SELECT COUNT(*) FROM dmz_space WHERE c_orgid=?"), orgID)
err = row.Scan(&m)
if err == nil {
spaces = m
} else {
s.Runtime.Log.Error("onboard.ContentCounts", err)
}
row = s.Runtime.Db.QueryRow("SELECT COUNT(*) FROM dmz_doc")
row = s.Runtime.Db.QueryRow(s.Bind("SELECT COUNT(*) FROM dmz_doc WHERE c_orgid=?"), orgID)
err = row.Scan(&m)
if err == nil {
docs = m
} else {
s.Runtime.Log.Error("onboard.ContentCounts", err)
}
return