mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: list memos with pinned
This commit is contained in:
@ -81,7 +81,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
|
||||
`memo.updated_ts AS updated_ts`,
|
||||
`memo.row_status AS row_status`,
|
||||
`memo.visibility AS visibility`,
|
||||
`memo_organizer.pinned AS pinned`,
|
||||
`COALESCE(memo_organizer.pinned, 0) AS pinned`,
|
||||
`memo_relation.related_memo_id AS parent_id`,
|
||||
}
|
||||
if !find.ExcludeContent {
|
||||
@ -110,7 +110,6 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
|
||||
list := make([]*store.Memo, 0)
|
||||
for rows.Next() {
|
||||
var memo store.Memo
|
||||
pinned := sql.NullBool{}
|
||||
dests := []any{
|
||||
&memo.ID,
|
||||
&memo.CreatorID,
|
||||
@ -118,7 +117,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
|
||||
&memo.UpdatedTs,
|
||||
&memo.RowStatus,
|
||||
&memo.Visibility,
|
||||
&pinned,
|
||||
&memo.Pinned,
|
||||
&memo.ParentID,
|
||||
}
|
||||
if !find.ExcludeContent {
|
||||
@ -127,9 +126,6 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
|
||||
if err := rows.Scan(dests...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if pinned.Valid {
|
||||
memo.Pinned = pinned.Bool
|
||||
}
|
||||
list = append(list, &memo)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user