Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(chore): Pro activities feed should always use Latest
· 30564fdd
Emiliano Balbuena
authored
Nov 27, 2019
30564fdd
Merge branch 'goal/pro-activities-feed' into 'master'
· 756ad84e
Mark Harding
authored
Nov 27, 2019
Pro activities feed should always use Latest Closes
#1165
See merge request
!408
756ad84e
Hide whitespace changes
Inline
Side-by-side
Controllers/api/v2/pro/content.php
View file @
756ad84e
...
...
@@ -43,9 +43,12 @@ class content implements Interfaces\Api
}
$type
=
''
;
$algorithm
=
strtolower
(
$_GET
[
'algorithm'
]
??
'top'
);
switch
(
$pages
[
1
])
{
case
'activities'
:
$type
=
'activity'
;
$algorithm
=
'latest'
;
break
;
case
'images'
:
$type
=
'object:image'
;
...
...
@@ -127,7 +130,7 @@ class content implements Interfaces\Api
'custom_type'
=>
null
,
'limit'
=>
$limit
,
'type'
=>
$type
,
'algorithm'
=>
'top'
,
'algorithm'
=>
$algorithm
,
'period'
=>
'7d'
,
'sync'
=>
$sync
,
'from_timestamp'
=>
$fromTimestamp
,
...
...
@@ -159,7 +162,7 @@ class content implements Interfaces\Api
try
{
$result
=
$this
->
getData
(
$entities
,
$opts
,
$asActivities
,
$sync
);
if
(
$result
->
count
()
<=
static
::
MIN_COUNT
)
{
if
(
$opts
[
'algorithm'
]
!==
'latest'
&&
$result
->
count
()
<=
static
::
MIN_COUNT
)
{
$opts
[
'algorithm'
]
=
'latest'
;
$result
=
$this
->
getData
(
$entities
,
$opts
,
$asActivities
,
$sync
);
}
...
...