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:
@@ -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({
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user