This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
2020-09-10 10:15:54 +00:00
|
|
|
const db = require("../db");
|
2020-09-10 12:03:56 +00:00
|
|
|
const { getYesterdayISOString } = require("../utils");
|
2020-09-10 10:15:54 +00:00
|
|
|
|
2021-04-29 11:43:40 +00:00
|
|
|
// returns all extended health check entries
|
2020-09-10 10:15:54 +00:00
|
|
|
module.exports = (req, res) => {
|
2020-09-10 12:03:56 +00:00
|
|
|
const yesterday = getYesterdayISOString();
|
|
|
|
const entries = db
|
2021-04-29 11:43:40 +00:00
|
|
|
.get("extended")
|
2020-09-10 12:03:56 +00:00
|
|
|
.orderBy("date", "desc")
|
|
|
|
.filter(({ date }) => date > yesterday)
|
|
|
|
.value();
|
2020-09-10 10:15:54 +00:00
|
|
|
|
|
|
|
res.send(entries);
|
|
|
|
};
|