Fix Seed Jumlah Pengangguran

This commit is contained in:
2025-08-23 11:39:16 +08:00
parent 8a275c2a32
commit 3081e426bd
2 changed files with 6 additions and 3 deletions

View File

@@ -681,9 +681,12 @@ import pelayananTelunjukSaktiDesa from "./data/desa/layanan/pelayananTelunjukSak
console.log("hubungan organisasi success ...");
for (const d of detailDataPengangguran) {
// Convert the year to a Date object (using January 1st of the year as the date)
const yearAsDate = new Date(d.year, 0, 1);
await prisma.detailDataPengangguran.upsert({
where: {
month_year: { month: d.month, year: d.year },
month_year: { month: d.month, year: yearAsDate },
},
update: {
totalUnemployment: d.totalUnemployment,
@@ -693,7 +696,7 @@ import pelayananTelunjukSaktiDesa from "./data/desa/layanan/pelayananTelunjukSak
},
create: {
month: d.month,
year: d.year,
year: yearAsDate,
totalUnemployment: d.totalUnemployment,
educatedUnemployment: d.educatedUnemployment,
uneducatedUnemployment: d.uneducatedUnemployment,