upd: api jenna ai
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import Elysia, { t } from "elysia"
|
||||
import type { StatusPengaduan } from "generated/prisma"
|
||||
import _ from "lodash"
|
||||
import { createSurat } from "../lib/create-surat"
|
||||
import { getLastUpdated } from "../lib/get-last-updated"
|
||||
import { generateNoPengajuanSurat } from "../lib/no-pengajuan-surat"
|
||||
@@ -294,8 +293,8 @@ const PelayananRoute = new Elysia({
|
||||
})
|
||||
.post("/create", async ({ body, headers }) => {
|
||||
const { kategoriId, dataText, syaratDokumen } = body
|
||||
const namaWarga = headers['x-user'] || ""
|
||||
const noTelepon = headers['x-phone'] || ""
|
||||
const namaWarga = headers['x-user'] || "amalia"
|
||||
const noTelepon = headers['x-phone'] || "08980185458"
|
||||
const noPengajuan = await generateNoPengajuanSurat()
|
||||
let idCategoryFix = kategoriId
|
||||
let idWargaFix = ""
|
||||
@@ -370,19 +369,19 @@ const PelayananRoute = new Elysia({
|
||||
dataInsertSyaratDokumen.push({
|
||||
idPengajuanLayanan: pengaduan.id,
|
||||
idCategory: idCategoryFix,
|
||||
jenis: jenisFix?.name || "",
|
||||
jenis: item.jenis,
|
||||
value: item.value,
|
||||
})
|
||||
}
|
||||
|
||||
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.toLowerCase() == item.jenis.toLowerCase())
|
||||
console.log('data text fix', jenisFix)
|
||||
dataInsertDataText.push({
|
||||
idPengajuanLayanan: pengaduan.id,
|
||||
idCategory: idCategoryFix,
|
||||
jenis: jenisFix || "",
|
||||
jenis: item.jenis,
|
||||
value: item.value,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user