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++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
const activeAV = article?.data.filter(
|
const activeAV = article?.data.filter(
|
||||||
(c: any) =>
|
(c: any) =>
|
||||||
c?.CustomerArticleNumber === data[i].customerArticleNo?.toString(),
|
c?.customerArticleNumber === data[i].customerArticleNo?.toString(),
|
||||||
);
|
);
|
||||||
const newData = data[i];
|
const newData = data[i];
|
||||||
//console.log(activeAV[0].IdArtikelvarianten);
|
//console.log(activeAV[0].IdArtikelvarianten);
|
||||||
|
|
||||||
forecaseEDIDATA.push({
|
forecaseEDIDATA.push({
|
||||||
...newData,
|
...newData,
|
||||||
article: activeAV[0].IdArtikelvarianten,
|
article: activeAV.length > 0 ? activeAV[0].article : 0,
|
||||||
description: activeAV[0].Bezeichnung, // change this later once we migrate more items
|
description:
|
||||||
|
activeAV.length > 0 ? activeAV[0].description : "No Av Created",
|
||||||
requirementDate: new Date(newData.requirementDate),
|
requirementDate: new Date(newData.requirementDate),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(forecaseEDIDATA[0]);
|
//console.log(forecaseEDIDATA[0]);
|
||||||
const { data: f, error: ef } = await tryCatch(
|
const { data: f, error: ef } = await tryCatch(
|
||||||
db.insert(forecastData).values(forecaseEDIDATA),
|
db.insert(forecastData).values(forecaseEDIDATA),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user