Merge pull request 'upd: api detail pengaduan jenna ai' (#40) from amalia/26-nov-25 into main
Reviewed-on: http://wibugit.wibudev.com/wibu/jenna-mcp/pulls/40
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import Elysia, { t } from "elysia"
|
import Elysia, { t } from "elysia"
|
||||||
import type { StatusPengaduan } from "generated/prisma"
|
import type { StatusPengaduan } from "generated/prisma"
|
||||||
|
import _ from "lodash"
|
||||||
import { v4 as uuidv4 } from "uuid"
|
import { v4 as uuidv4 } from "uuid"
|
||||||
import { getLastUpdated } from "../lib/get-last-updated"
|
import { getLastUpdated } from "../lib/get-last-updated"
|
||||||
import { mimeToExtension } from "../lib/mimetypeToExtension"
|
import { mimeToExtension } from "../lib/mimetypeToExtension"
|
||||||
@@ -332,7 +333,7 @@ const PengaduanRoute = new Elysia({
|
|||||||
|
|
||||||
const dataHistory = await prisma.historyPengaduan.findMany({
|
const dataHistory = await prisma.historyPengaduan.findMany({
|
||||||
where: {
|
where: {
|
||||||
idPengaduan: id,
|
idPengaduan: data?.id,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -348,23 +349,20 @@ const PengaduanRoute = new Elysia({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const dataHistoryFix = dataHistory.map((item) => {
|
|
||||||
return {
|
const dataHistoryFix = dataHistory.map((item: any) => ({
|
||||||
id: item.id,
|
..._.omit(item, ["User", "createdAt"]),
|
||||||
deskripsi: item.deskripsi,
|
nameUser: item.User?.name,
|
||||||
status: item.status,
|
createdAt: item.createdAt.toLocaleString("id-ID", {
|
||||||
createdAt: item.createdAt.toLocaleString("id-ID", {
|
day: "2-digit",
|
||||||
day: "2-digit",
|
month: "short",
|
||||||
month: "short",
|
year: "numeric",
|
||||||
year: "numeric",
|
hour: "2-digit",
|
||||||
hour: "2-digit",
|
minute: "2-digit",
|
||||||
minute: "2-digit",
|
hour12: false
|
||||||
hour12: false
|
}),
|
||||||
}),
|
}))
|
||||||
idUser: item.idUser,
|
|
||||||
nameUser: item.User?.name,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const warga = {
|
const warga = {
|
||||||
name: data?.Warga?.name,
|
name: data?.Warga?.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user