Code changes done for industry code mandatory
This commit is contained in:
parent
c18ff7c9f9
commit
d183e5bf3b
@ -1355,7 +1355,7 @@ exports.establishmentBulkUpload = async (req, res) => {
|
|||||||
// -------------------------------------------------------
|
// -------------------------------------------------------
|
||||||
// REQUIRED HEADERS
|
// REQUIRED HEADERS
|
||||||
// -------------------------------------------------------
|
// -------------------------------------------------------
|
||||||
const required = ["establishment_id", "factory_name", "user_name", "email", "emirate"];
|
const required = ["establishment_id", "factory_name", "user_name", "email", "emirate", "industry_code_current_production"];
|
||||||
const firstKeys = Object.keys(rows[0]);
|
const firstKeys = Object.keys(rows[0]);
|
||||||
|
|
||||||
const missingHeaders = required.filter(h => !firstKeys.includes(h));
|
const missingHeaders = required.filter(h => !firstKeys.includes(h));
|
||||||
@ -1446,6 +1446,7 @@ exports.establishmentBulkUpload = async (req, res) => {
|
|||||||
const factory = r.factory_name;
|
const factory = r.factory_name;
|
||||||
const email = r.email;
|
const email = r.email;
|
||||||
const emirate = r.emirate;
|
const emirate = r.emirate;
|
||||||
|
const industry_code_current_production = r.industry_code_current_production;
|
||||||
|
|
||||||
const missing = [];
|
const missing = [];
|
||||||
if (!est) missing.push("Establishment ID");
|
if (!est) missing.push("Establishment ID");
|
||||||
@ -1453,6 +1454,7 @@ exports.establishmentBulkUpload = async (req, res) => {
|
|||||||
if (!r.user_name) missing.push("User Name");
|
if (!r.user_name) missing.push("User Name");
|
||||||
if (!email) missing.push("Email");
|
if (!email) missing.push("Email");
|
||||||
if (!emirate) missing.push("Emirate");
|
if (!emirate) missing.push("Emirate");
|
||||||
|
if (!industry_code_current_production) missing.push("Industry Code Current Production");
|
||||||
|
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
errors.push({ row: rowNum, error: `Missing required fields: ${missing.join(", ")}` });
|
errors.push({ row: rowNum, error: `Missing required fields: ${missing.join(", ")}` });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user