fix(dm): type in customer article number
This commit is contained in:
@@ -35,20 +35,21 @@ export const forecastEdiData = async (data: ForecastData[]) => {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const activeAV = article?.data.filter(
|
||||
(c: any) =>
|
||||
c?.CustomerArticleNumber === data[i].customerArticleNo?.toString(),
|
||||
c?.customerArticleNumber === data[i].customerArticleNo?.toString(),
|
||||
);
|
||||
const newData = data[i];
|
||||
//console.log(activeAV[0].IdArtikelvarianten);
|
||||
|
||||
forecaseEDIDATA.push({
|
||||
...newData,
|
||||
article: activeAV[0].IdArtikelvarianten,
|
||||
description: activeAV[0].Bezeichnung, // change this later once we migrate more items
|
||||
article: activeAV.length > 0 ? activeAV[0].article : 0,
|
||||
description:
|
||||
activeAV.length > 0 ? activeAV[0].description : "No Av Created",
|
||||
requirementDate: new Date(newData.requirementDate),
|
||||
});
|
||||
}
|
||||
|
||||
console.log(forecaseEDIDATA[0]);
|
||||
//console.log(forecaseEDIDATA[0]);
|
||||
const { data: f, error: ef } = await tryCatch(
|
||||
db.insert(forecastData).values(forecaseEDIDATA),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user