import { ERPObject } from "../types/erp-types.js"; /** * Remove all fields listed in idField[] the from the payload */ export const getPayloadWithoutIDField = ( recordset: ERPObject[], idField: string[] ): ERPObject[] => { const data: ERPObject[] = recordset.map((row) => { const transformedRow: ERPObject = {}; Object.keys(row).forEach((key) => { if (!idField.includes(key)) { transformedRow[key] = row[key]?.toString() || ""; } }); return transformedRow; }) || []; return data; };