Invesment

Fix:
- tampilan dokumen dan file prospektus
- create & edit dokumen
- list rekap dokumen dan tampilan ( untuk non author )

### No Issue
This commit is contained in:
2025-10-01 14:40:50 +08:00
parent 5f05d1f7f0
commit 250b216a54
7 changed files with 403 additions and 90 deletions

View File

@@ -3,7 +3,6 @@ import {
apiInvestmentDelete,
apiInvestmentUpdateStatus,
} from "@/service/api-client/api-investment";
import { deleteFileService } from "@/service/upload-service";
import { router } from "expo-router";
import { useState } from "react";
import Toast from "react-native-toast-message";
@@ -136,36 +135,14 @@ export default function Investment_ButtonStatusSection({
id: id as string,
});
console.log("[RESPONSE]", JSON.stringify(response, null, 2));
console.log("[RESPONSE DELETE]", JSON.stringify(response, null, 2));
if (response.success) {
const deleteImage = await deleteFileService({
id: response?.data?.imageId as string,
});
if (!deleteImage.success) {
Toast.show({
type: "error",
text1: "Gagal Hapus Data",
});
return;
}
const deleteFile = await deleteFileService({
id: response?.data?.prospektusFileId as string,
});
if (!deleteFile.success) {
Toast.show({
type: "error",
text1: "Gagal Hapus Data",
});
return;
}
Toast.show({
type: "success",
text1: "Berhasil Hapus Data",
});
router.back();
} else {
Toast.show({

View File

@@ -1,5 +1,5 @@
import { BaseBox, Grid, TextCustom } from "@/components";
import { Href } from "expo-router";
import { BaseBox, ClickableCustom, Grid, TextCustom } from "@/components";
import { Href, router } from "expo-router";
export default function Investment_BoxDetailDocument({
title,
@@ -8,17 +8,19 @@ export default function Investment_BoxDetailDocument({
}: {
title: string;
leftIcon?: React.ReactNode;
href?: Href;
href?: Href | string;
}) {
return (
<>
<BaseBox href={href}>
<BaseBox>
<Grid>
<Grid.Col span={leftIcon ? 10 : 12}>
<TextCustom truncate>
{title ||
`Judul Dokumen: Lorem, ipsum dolor sit amet consectetur adipisicing elit.`}
</TextCustom>
<ClickableCustom onPress={() => router.push(href as any)}>
<TextCustom truncate>
{title ||
`Judul Dokumen: Lorem, ipsum dolor sit amet consectetur adipisicing elit.`}
</TextCustom>
</ClickableCustom>
</Grid.Col>
{leftIcon && <Grid.Col span={2}>{leftIcon}</Grid.Col>}
</Grid>