Add parameter for date ranges to return all checks
This commit is contained in:
1 parent
a84916f0b0
commit
ec1563bba2
2 files changed
+3
-2
No files matched your search
@@ -198,7 +198,7 @@ const getIncidents = (checks) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get date range parameters
|
* Get date range parameters
|
||||||
* @param {string} dateRange - 'day' | 'week' | 'month'
|
* @param {string} dateRange - 'day' | 'week' | 'month' | 'all'
|
||||||
* @returns {Object} Start and end dates
|
* @returns {Object} Start and end dates
|
||||||
*/
|
*/
|
||||||
const getDateRange = (dateRange) => {
|
const getDateRange = (dateRange) => {
|
||||||
@@ -206,6 +206,7 @@ const getDateRange = (dateRange) => {
|
|||||||
day: new Date(new Date().setDate(new Date().getDate() - 1)),
|
day: new Date(new Date().setDate(new Date().getDate() - 1)),
|
||||||
week: new Date(new Date().setDate(new Date().getDate() - 7)),
|
week: new Date(new Date().setDate(new Date().getDate() - 7)),
|
||||||
month: new Date(new Date().setMonth(new Date().getMonth() - 1)),
|
month: new Date(new Date().setMonth(new Date().getMonth() - 1)),
|
||||||
|
all: new Date(0),
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
start: startDates[dateRange],
|
start: startDates[dateRange],
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ const getMonitorStatsByIdQueryValidation = joi.object({
|
|||||||
status: joi.string(),
|
status: joi.string(),
|
||||||
limit: joi.number(),
|
limit: joi.number(),
|
||||||
sortOrder: joi.string().valid("asc", "desc"),
|
sortOrder: joi.string().valid("asc", "desc"),
|
||||||
dateRange: joi.string().valid("day", "week", "month"),
|
dateRange: joi.string().valid("day", "week", "month", "all"),
|
||||||
numToDisplay: joi.number(),
|
numToDisplay: joi.number(),
|
||||||
normalize: joi.boolean(),
|
normalize: joi.boolean(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user