Skip to content

Commit

Permalink
Merge pull request #5261 from Countly/drill-params-fix
Browse files Browse the repository at this point in the history
[drill][fix] allow "prevMonth" as period param
  • Loading branch information
Cookiezaurs committed May 27, 2024
2 parents b1ad706 + 90fd60a commit f3ed352
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/lib/countly.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,16 @@ countlyCommon.isValidPeriodParam = function(period) {
}

if (typeof period === 'object') {
return Object.prototype.hasOwnProperty.call(period, 'since') || Object.prototype.hasOwnProperty.call(period, 'period');
if (Object.prototype.hasOwnProperty.call(period, 'period')) {
return countlyCommon.isValidPeriodParam(period.period);
}
else {
return Object.prototype.hasOwnProperty.call(period, 'since');
}
}

return period === 'month' ||
period === 'prevMonth' ||
period === 'day' ||
period === 'yesterday' ||
period === 'hour' ||
Expand Down

0 comments on commit f3ed352

Please sign in to comment.