Skip to content

Commit

Permalink
Specify correct orderBy parameter for the Recommended tab (#83185)
Browse files Browse the repository at this point in the history
The "Recommended" tab should show posts ordered by popularity.  Previously, we ordered "Recommended" by date so it showed the same posts as "Latest".
  • Loading branch information
markbiek authored Oct 18, 2023
1 parent 40e78f0 commit c12c945
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/state/data-layer/wpcom/read/streams/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ const streamApis = {
tag_recs_per_card: 5,
site_recs_per_card: 5,
age_based_decay: 0.5,
// Default order is by date (latest) unless we're on the recommended tab which shows popular instead.
orderBy: streamKeySuffix( streamKey ).includes( 'recommended' ) ? 'popular' : 'date',
} ),
apiNamespace: 'wpcom/v2',
},
Expand Down
1 change: 1 addition & 0 deletions client/state/data-layer/wpcom/read/streams/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe( 'streams', () => {
site_recs_per_card: 5,
tags: [],
age_based_decay: 0.5,
orderBy: 'popular',
},
},
},
Expand Down

0 comments on commit c12c945

Please sign in to comment.