mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 03:24:11 +00:00
add f.created to join, add Created to Scan
This commit is contained in:
parent
22de459a72
commit
a352a3518a
1 changed files with 7 additions and 6 deletions
13
database.go
13
database.go
|
@ -14,15 +14,16 @@ import (
|
|||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"github.com/writeas/web-core/silobridge"
|
||||
wf_db "github.com/writefreely/writefreely/db"
|
||||
"github.com/writefreely/writefreely/parse"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"github.com/writeas/web-core/silobridge"
|
||||
wf_db "github.com/writefreely/writefreely/db"
|
||||
"github.com/writefreely/writefreely/parse"
|
||||
|
||||
"github.com/guregu/null"
|
||||
"github.com/guregu/null/zero"
|
||||
uuid "github.com/nu7hatch/gouuid"
|
||||
|
@ -1497,7 +1498,7 @@ ORDER BY created `+order+limitStr, collID, lang)
|
|||
}
|
||||
|
||||
func (db *datastore) GetAPFollowers(c *Collection) (*[]RemoteUser, error) {
|
||||
rows, err := db.Query("SELECT actor_id, inbox, shared_inbox FROM remotefollows f INNER JOIN remoteusers u ON f.remote_user_id = u.id WHERE collection_id = ?", c.ID)
|
||||
rows, err := db.Query("SELECT actor_id, inbox, shared_inbox, f.created FROM remotefollows f INNER JOIN remoteusers u ON f.remote_user_id = u.id WHERE collection_id = ?", c.ID)
|
||||
if err != nil {
|
||||
log.Error("Failed selecting from followers: %v", err)
|
||||
return nil, impart.HTTPError{http.StatusInternalServerError, "Couldn't retrieve followers."}
|
||||
|
@ -1507,7 +1508,7 @@ func (db *datastore) GetAPFollowers(c *Collection) (*[]RemoteUser, error) {
|
|||
followers := []RemoteUser{}
|
||||
for rows.Next() {
|
||||
f := RemoteUser{}
|
||||
err = rows.Scan(&f.ActorID, &f.Inbox, &f.SharedInbox)
|
||||
err = rows.Scan(&f.ActorID, &f.Inbox, &f.SharedInbox, &f.Created)
|
||||
followers = append(followers, f)
|
||||
}
|
||||
return &followers, nil
|
||||
|
|
Loading…
Reference in a new issue