@@ -69,10 +69,9 @@ public class StatsServiceRemoteV2: ServiceRemoteWordPressComREST {
6969 let path = self . path ( forEndpoint: " sites/ \( siteID) / \( pathComponent) / " , withVersion: . _1_1)
7070
7171 let staticProperties = [ " period " : period. stringValue,
72- " date " : periodDataQueryDateFormatter. string ( from: endingOn) ,
73- " max " : limit as AnyObject ] as [ String : AnyObject ]
72+ " date " : periodDataQueryDateFormatter. string ( from: endingOn) ] as [ String : AnyObject ]
7473
75- let classProperties = TimeStatsType . queryProperties ( with: endingOn, period: period) as [ String : AnyObject ]
74+ let classProperties = TimeStatsType . queryProperties ( with: endingOn, period: period, maxCount : limit ) as [ String : AnyObject ]
7675
7776 let properties = staticProperties. merging ( classProperties) { val1, _ in
7877 return val1
@@ -263,13 +262,13 @@ public protocol StatsTimeIntervalData {
263262
264263 init ? ( date: Date , period: StatsPeriodUnit , jsonDictionary: [ String : AnyObject ] )
265264
266- static func queryProperties( with date: Date , period: StatsPeriodUnit ) -> [ String : String ]
265+ static func queryProperties( with date: Date , period: StatsPeriodUnit , maxCount : Int ) -> [ String : String ]
267266}
268267
269268extension StatsTimeIntervalData {
270269
271- public static func queryProperties( with date: Date , period: StatsPeriodUnit ) -> [ String : String ] {
272- return [ : ]
270+ public static func queryProperties( with date: Date , period: StatsPeriodUnit , maxCount : Int ) -> [ String : String ] {
271+ return [ " max " : String ( maxCount ) ]
273272 }
274273
275274 // Most of the responses for time data come in a unwieldy format, that requires awkwkard unwrapping
0 commit comments