Fix Edit di Admin APbdes, dan fix data real di apbdes user
This commit is contained in:
@@ -12,7 +12,7 @@ type APBDesItemInput = {
|
||||
selisih: number;
|
||||
persentase: number;
|
||||
level: number;
|
||||
tipe: string;
|
||||
tipe?: string | null;
|
||||
};
|
||||
|
||||
type FormCreate = {
|
||||
|
||||
@@ -15,7 +15,7 @@ const ApbdesItemSchema = t.Object({
|
||||
selisih: t.Number(),
|
||||
persentase: t.Number(),
|
||||
level: t.Number(),
|
||||
tipe: t.String(), // misal: "pendapatan" atau "belanja"
|
||||
tipe: t.Optional(t.Union([t.String(), t.Null()])) // misal: "pendapatan" atau "belanja"
|
||||
});
|
||||
|
||||
const APBDes = new Elysia({
|
||||
|
||||
@@ -10,7 +10,7 @@ type APBDesItemInput = {
|
||||
selisih: number;
|
||||
persentase: number;
|
||||
level: number;
|
||||
tipe: string;
|
||||
tipe?: string | null;
|
||||
};
|
||||
|
||||
type FormUpdateBody = {
|
||||
@@ -54,7 +54,7 @@ export default async function apbdesUpdate(context: Context) {
|
||||
selisih: item.anggaran - item.realisasi,
|
||||
persentase: item.anggaran > 0 ? (item.realisasi / item.anggaran) * 100 : 0,
|
||||
level: item.level,
|
||||
tipe: item.tipe,
|
||||
tipe: item.tipe || null,
|
||||
isActive: true,
|
||||
})),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user