promotion/commodity.js

XiaoMu-PosSystem · server/src/api/market/promotion/commodity.js · javascript · MIT
pos

Express router handling CRUD for promotion commodity data in a POS system.

// Source: https://github.com/vhvy/XiaoMu-PosSystem | License: MIT | Copyright 2019 vhvy
// Provided via justclaw.it.com; keep this notice with the code.
import express from "express";
import PromotionTask from "../../../tasks/market/promotion.js";
import CommodityTask from "../../../tasks/commodity.js";
import { throwError } from "../../../middleware/handleError.js";
import { validBody } from "../../../middleware/validBody.js";
import { addCommoditySchema, editCommoditySchema } from "../../../schema/promotion.js";

const route = express.Router();

route.get("/:query", async (req, res, next) => {
    // 获取某个促销活动的所有商品详情

    const { query } = req.params;

    const queryPromotionResult = await PromotionTask.getPromotion(query);
    if (!queryPromotionResult) {
        return throwError(next

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key