mirror of
https://github.com/writeas/writefreely
synced 2025-02-09 10:38:47 +01:00
Fetch collection description with user collections
This commit is contained in:
parent
f512f983ec
commit
3e1d3530ad
@ -1515,7 +1515,7 @@ func (db *datastore) GetPinnedPosts(coll *CollectionObj) (*[]PublicPost, error)
|
||||
}
|
||||
|
||||
func (db *datastore) GetCollections(u *User) (*[]Collection, error) {
|
||||
rows, err := db.Query("SELECT id, alias, title, privacy, view_count FROM collections LEFT JOIN domains ON id = collection_id WHERE owner_id = ? ORDER BY id ASC", u.ID)
|
||||
rows, err := db.Query("SELECT id, alias, title, description, privacy, view_count FROM collections WHERE owner_id = ? ORDER BY id ASC", u.ID)
|
||||
if err != nil {
|
||||
log.Error("Failed selecting from collections: %v", err)
|
||||
return nil, impart.HTTPError{http.StatusInternalServerError, "Couldn't retrieve user collections."}
|
||||
@ -1527,7 +1527,7 @@ func (db *datastore) GetCollections(u *User) (*[]Collection, error) {
|
||||
var isActive, isSecure null.Bool
|
||||
for rows.Next() {
|
||||
c := Collection{}
|
||||
err = rows.Scan(&c.ID, &c.Alias, &c.Title, &c.Visibility, &c.Views)
|
||||
err = rows.Scan(&c.ID, &c.Alias, &c.Title, &c.Description, &c.Visibility, &c.Views)
|
||||
if err != nil {
|
||||
log.Error("Failed scanning row: %v", err)
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user