mirror of
https://github.com/alexgo-io/redstone-cache-layer.git
synced 2026-01-12 08:34:36 +08:00
chore: revert removal of packages
This commit is contained in:
@@ -96,7 +96,8 @@ export const packages = (router: Router) => {
|
||||
"/packages/latest",
|
||||
asyncHandler(async (req, res) => {
|
||||
console.log("Getting latest packages")
|
||||
throwExpiredApiError()
|
||||
const initialMongoQuery = {};
|
||||
return await findPackage(req, res, initialMongoQuery);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -108,7 +109,14 @@ export const packages = (router: Router) => {
|
||||
"/packages",
|
||||
asyncHandler(async (req, res) => {
|
||||
console.log("Getting packages by timestamp")
|
||||
throwExpiredApiError()
|
||||
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);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user