Revert "chore: revert removal of packages"

This reverts commit 76ae41dc8b.
This commit is contained in:
Wojtek Rybakiewicz
2023-12-07 16:15:16 +01:00
parent 76ae41dc8b
commit 0a7b40d37c

View File

@@ -96,8 +96,7 @@ export const packages = (router: Router) => {
"/packages/latest",
asyncHandler(async (req, res) => {
console.log("Getting latest packages")
const initialMongoQuery = {};
return await findPackage(req, res, initialMongoQuery);
throwExpiredApiError()
})
);
@@ -109,14 +108,7 @@ export const packages = (router: Router) => {
"/packages",
asyncHandler(async (req, res) => {
console.log("Getting packages by timestamp")
if (!req.query.toTimestamp) {
throw new Error("toTimestamp query param is required");
}
const initialMongoQuery = {
timestamp: { $lte: req.query.toTimestamp },
};
return await findPackage(req, res, initialMongoQuery);
throwExpiredApiError()
})
);
};