upd: api #66
@@ -363,17 +363,22 @@ const PelayananRoute = new Elysia({
|
|||||||
let dataInsertDataText = []
|
let dataInsertDataText = []
|
||||||
|
|
||||||
for (const item of syaratDokumen) {
|
for (const item of syaratDokumen) {
|
||||||
|
console.log('syarat dokumen', item)
|
||||||
const jenisFix = (category?.syaratDokumen as Array<{ name: string; desc: string }>)
|
const jenisFix = (category?.syaratDokumen as Array<{ name: string; desc: string }>)
|
||||||
?.find((v) => v.name === item.jenis || v.desc === item.jenis); dataInsertSyaratDokumen.push({
|
?.find((v) => v.name === item.jenis || v.desc === item.jenis);
|
||||||
idPengajuanLayanan: pengaduan.id,
|
console.log('jenis fix', jenisFix)
|
||||||
idCategory: idCategoryFix,
|
dataInsertSyaratDokumen.push({
|
||||||
jenis: jenisFix?.name || "",
|
idPengajuanLayanan: pengaduan.id,
|
||||||
value: item.value,
|
idCategory: idCategoryFix,
|
||||||
})
|
jenis: jenisFix?.name || "",
|
||||||
|
value: item.value,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const item of dataText) {
|
for (const item of dataText) {
|
||||||
|
console.log('dataitem', item)
|
||||||
const jenisFix = category?.dataText.find((v) => v == _.lowerCase(item.jenis))
|
const jenisFix = category?.dataText.find((v) => v == _.lowerCase(item.jenis))
|
||||||
|
console.log('data text fix', jenisFix)
|
||||||
dataInsertDataText.push({
|
dataInsertDataText.push({
|
||||||
idPengajuanLayanan: pengaduan.id,
|
idPengajuanLayanan: pengaduan.id,
|
||||||
idCategory: idCategoryFix,
|
idCategory: idCategoryFix,
|
||||||
@@ -382,8 +387,8 @@ const PelayananRoute = new Elysia({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(dataInsertSyaratDokumen)
|
console.log('datainsertsyaratdokumen', dataInsertSyaratDokumen)
|
||||||
console.log(dataInsertDataText)
|
console.log('datainsertdatatext', dataInsertDataText)
|
||||||
|
|
||||||
await prisma.syaratDokumenPelayanan.createMany({
|
await prisma.syaratDokumenPelayanan.createMany({
|
||||||
data: dataInsertSyaratDokumen,
|
data: dataInsertSyaratDokumen,
|
||||||
|
|||||||
Reference in New Issue
Block a user