mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Grouped recommendations in Portal
fixes https://github.com/TryGhost/Product/issues/3893
This commit is contained in:
parent
9a4c0ba33b
commit
ff61b33049
1 changed files with 7 additions and 1 deletions
|
@ -251,8 +251,14 @@ const RecommendationsPage = () => {
|
|||
|
||||
useEffect(() => {
|
||||
api.site.recommendations({limit: 100}).then((data) => {
|
||||
const withOneClickSubscribe = data.recommendations.filter(recommendation => recommendation.one_click_subscribe);
|
||||
const withoutOneClickSubscribe = data.recommendations.filter(recommendation => !recommendation.one_click_subscribe);
|
||||
|
||||
setRecommendations(
|
||||
shuffleRecommendations(data.recommendations)
|
||||
[
|
||||
...shuffleRecommendations(withOneClickSubscribe),
|
||||
...shuffleRecommendations(withoutOneClickSubscribe)
|
||||
]
|
||||
);
|
||||
}).catch((err) => {
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
Loading…
Add table
Reference in a new issue