diff options
Diffstat (limited to 'Database.go')
-rw-r--r-- | Database.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Database.go b/Database.go index d0f6892..f79bf50 100644 --- a/Database.go +++ b/Database.go @@ -290,8 +290,11 @@ func WritePreviewToDB(db *sql.DB, obj NestedObjectBase) { func GetActivityFromDB(db *sql.DB, id string) Collection { var nColl Collection + var nActor Actor var result []ObjectBase + nColl.Actor = &nActor + query := `select actor, id, name, content, type, published, updated, attributedto, attachment, preview, actor from activitystream where id=$1 order by updated asc` rows, err := db.Query(query, id) @@ -305,7 +308,8 @@ func GetActivityFromDB(db *sql.DB, id string) Collection { var attachID string var previewID string - err = rows.Scan(&nColl.Actor, &post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.Updated, &post.AttributedTo, &attachID, &previewID, &actor.Id) + + err = rows.Scan(&nColl.Actor.Id, &post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.Updated, &post.AttributedTo, &attachID, &previewID, &actor.Id) CheckError(err, "error scan object into post struct") |