Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 77x 23x 23x 23x | import statistics_monthlySalesStatistics_get from "./statistics_monthlySalesStatistics_get.js";
import statistics_monthlyCategoriesStatistics_get from "./statistics_monthlyCategoriesStatistics_get.js";
import statistics_categories_get from "./statistics_categories_get.js";
import statistics_products_get from "./statistics_products_get.js";
import statistics_salesGrowth_get from "./statistics_salesGrowth_get.js";
import statistics_topProducts_get from "./statistics_topProducts_get.js";
import statistics_topSeries_get from "./statistics_topSeries_get.js";
import statistics_users_get from "./statistics_users_get.js";
import statistics_topCustomers_get from "./statistics_topCustomers_get.js";
import statistics_orders_get from "./statistics_orders_get.js";
import statistics_usersOverview_get from "./statistics_usersOverview_get.js";
import asyncRouteHandler from "../../utilities/asyncRouteHandler.js";
const handlers = {
"monthly-sales-statistics": statistics_monthlySalesStatistics_get,
"monthly-categories-statistics": statistics_monthlyCategoriesStatistics_get,
"categories-statistics": statistics_categories_get,
"products-statistics": statistics_products_get,
"sales-growth": statistics_salesGrowth_get,
"top-products": statistics_topProducts_get,
"top-series": statistics_topSeries_get,
"users-statistics": statistics_users_get,
"top-customers": statistics_topCustomers_get,
"orders-statistics": statistics_orders_get,
"users-overview": statistics_usersOverview_get
}
export default asyncRouteHandler(
async function statistics_get(req, res) {
const { queryKey } = req.query;
if (queryKey) {
if (handlers[queryKey]) handlers[queryKey](req, res)
else Ereturn res.status(400).json({ message: "unknown query queryKey" });
} else E{
res.status(400).json({ message: "you have to specify query queryKey" })
}
}
) |