Changes in establishment product list : GWM

This commit is contained in:
Gowtham M 2025-11-12 10:32:22 +05:30
parent bef081d417
commit 15c250d28a

View File

@ -2,7 +2,7 @@ const { where } = require("sequelize");
const db = require("../models");
const EstablishmentProduct = db.EstablishmentProduct;
const Product = db.Product;
const UnitMaster = db.UnitMaster;
exports.createEstablishmentProduct = async (req, res) => {
try {
@ -30,6 +30,13 @@ exports.getAllEstablishmentProducts = async (req, res) => {
model: Product,
as: "product",
attributes: ["product_name", "hs_code", "hs_description"],
include: [
{
model: UnitMaster,
as: "unit",
attributes: ["id","uom_short_name","uom"],
},
],
},
],
});