Portofolio
Fix: - Sub bidang bisnis ### No Issu
This commit is contained in:
@@ -45,7 +45,9 @@ export default function Portofolio_ButtonCreate({
|
||||
!data.masterBidangBisnisId ||
|
||||
!data.alamatKantor ||
|
||||
!data.tlpn ||
|
||||
!data.deskripsi
|
||||
!data.deskripsi ||
|
||||
subBidangSelected.map((item) => item.id).includes("") ||
|
||||
subBidangSelected.map((item) => item.id).includes(null)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -53,6 +55,10 @@ export default function Portofolio_ButtonCreate({
|
||||
};
|
||||
|
||||
const handleCreatePortofolio = async () => {
|
||||
console.log(
|
||||
"Data sub bidang >>",
|
||||
JSON.stringify(subBidangSelected, null, 2)
|
||||
);
|
||||
if (!validaasiData()) {
|
||||
Toast.show({
|
||||
type: "info",
|
||||
@@ -90,18 +96,18 @@ export default function Portofolio_ButtonCreate({
|
||||
youtube: dataMedsos.youtube,
|
||||
subBidang: subBidangSelected,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await apiPortofolioCreate({
|
||||
data: newData,
|
||||
});
|
||||
console.log("Response >>", JSON.stringify(response, null, 2));
|
||||
// return router.replace(`/maps/create`);
|
||||
// return router.push(`/maps/create`);
|
||||
return router.back();
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
const response = await apiPortofolioCreate({
|
||||
data: newData,
|
||||
});
|
||||
console.log("Response >>", JSON.stringify(response, null, 2));
|
||||
// return router.replace(`/maps/create`);
|
||||
// return router.push(`/maps/create`);
|
||||
Toast.show({
|
||||
type: "success",
|
||||
text1: "Sukses",
|
||||
text2: "Data berhasil disimpan",
|
||||
});
|
||||
return router.back();
|
||||
} catch (error) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
|
||||
@@ -17,7 +17,13 @@ import { FontAwesome, Ionicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function Portofolio_Data({ data }: { data: any }) {
|
||||
export default function Portofolio_Data({
|
||||
data,
|
||||
listSubBidang,
|
||||
}: {
|
||||
data: any;
|
||||
listSubBidang: any[];
|
||||
}) {
|
||||
const { id } = useLocalSearchParams();
|
||||
|
||||
const listData = [
|
||||
@@ -83,6 +89,8 @@ export default function Portofolio_Data({ data }: { data: any }) {
|
||||
// },
|
||||
// ];
|
||||
|
||||
console.log("List Sub Bidang >>", JSON.stringify(listSubBidang, null, 2));
|
||||
|
||||
return (
|
||||
<>
|
||||
<BaseBox>
|
||||
@@ -137,20 +145,24 @@ export default function Portofolio_Data({ data }: { data: any }) {
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
))}
|
||||
{/* <View style={{ paddingLeft: 10 }}>
|
||||
{listSubBidang.map((item, index) => (
|
||||
<View style={{ paddingLeft: 10 }}>
|
||||
{listSubBidang?.map((item, index) => (
|
||||
<Grid key={index}>
|
||||
<Grid.Col span={2} style={{ alignItems: "center" }}>
|
||||
{item.icon}
|
||||
<Ionicons
|
||||
name="chevron-forward-outline"
|
||||
size={ICON_SIZE_SMALL}
|
||||
color="white"
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<TextCustom style={{ paddingLeft: 5 }}>
|
||||
{item.label}
|
||||
{item?.MasterSubBidangBisnis?.name || "-"}
|
||||
</TextCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
))}
|
||||
</View> */}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<DividerCustom labelPosition="top" color={AccentColor.blue} />
|
||||
|
||||
Reference in New Issue
Block a user