tambahan
This commit is contained in:
@@ -63,31 +63,27 @@ const TestPengaduanRoute = new Elysia({
|
|||||||
|
|
||||||
|
|
||||||
const nomorHP = normalizePhoneNumber({ phone: noTelepon })
|
const nomorHP = normalizePhoneNumber({ phone: noTelepon })
|
||||||
const cariWarga = await prisma.warga.findUnique({
|
const cariWarga = await prisma.warga.upsert({
|
||||||
where: {
|
where: {
|
||||||
phone: nomorHP,
|
phone: nomorHP,
|
||||||
}
|
},
|
||||||
})
|
create: {
|
||||||
|
name: "malik",
|
||||||
if (!cariWarga) {
|
phone: nomorHP,
|
||||||
const wargaCreate = await prisma.warga.create({
|
},
|
||||||
data: {
|
update: {
|
||||||
name: "malik",
|
name: "malik",
|
||||||
phone: nomorHP,
|
phone: nomorHP,
|
||||||
},
|
},
|
||||||
select: {
|
|
||||||
id: true
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const pengaduan = await prisma.pengaduan.create({
|
const pengaduan = await prisma.pengaduan.create({
|
||||||
data: {
|
data: {
|
||||||
title: judulPengaduan,
|
title: judulPengaduan,
|
||||||
detail: detailPengaduan,
|
detail: detailPengaduan,
|
||||||
idCategory: idCategoryFix,
|
idCategory: idCategoryFix,
|
||||||
idWarga: "malik",
|
idWarga: cariWarga.id,
|
||||||
location: lokasi,
|
location: lokasi,
|
||||||
image: "",
|
image: "",
|
||||||
noPengaduan,
|
noPengaduan,
|
||||||
|
|||||||
Reference in New Issue
Block a user