Clearing apple rejected

QC: Inno

Fix:
- app.config.js
- app/(application)/(user)/investment/[id]/index.tsx
- app/(application)/(user)/voting/(tabs)/index.tsx
- app/(application)/(user)/waiting-room.tsx
- app/(application)/terms-agreement.tsx
- context/AuthContext.tsx
- ios/HIPMIBadungConnect.xcodeproj/project.pbxproj
- ios/HIPMIBadungConnect/Info.plist
- screens/Authentication/LoginView.tsx
- screens/Authentication/VerificationView.tsx
- screens/Home/topFeatureSection.tsx
- screens/Invesment/BoxBerandaSection.tsx
- screens/Invesment/ButtonInvestasiSection.tsx
- screens/Invesment/DetailDataPublishSection.tsx
- service/api-client/api-voting.ts
- service/api-config.ts

### No Issue
This commit is contained in:
2025-12-02 17:48:24 +08:00
parent 98aaa126a1
commit 858b441a8c
16 changed files with 203 additions and 72 deletions

View File

@@ -19,7 +19,7 @@ export default {
"NSLocationWhenInUseUsageDescription": "Aplikasi membutuhkan akses lokasi untuk menampilkan peta.", "NSLocationWhenInUseUsageDescription": "Aplikasi membutuhkan akses lokasi untuk menampilkan peta.",
}, },
associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"], associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"],
buildNumber: "9", buildNumber: "10",
}, },
android: { android: {

View File

@@ -15,6 +15,7 @@ import Investment_ButtonInvestasiSection from "@/screens/Invesment/ButtonInvesta
import Invesment_ComponentBoxOnBottomDetail from "@/screens/Invesment/ComponentBoxOnBottomDetail"; import Invesment_ComponentBoxOnBottomDetail from "@/screens/Invesment/ComponentBoxOnBottomDetail";
import Invesment_DetailDataPublishSection from "@/screens/Invesment/DetailDataPublishSection"; import Invesment_DetailDataPublishSection from "@/screens/Invesment/DetailDataPublishSection";
import { apiInvestmentGetOne } from "@/service/api-client/api-investment"; import { apiInvestmentGetOne } from "@/service/api-client/api-investment";
import { countDownAndCondition } from "@/utils/countDownAndCondition";
import { AntDesign, MaterialIcons } from "@expo/vector-icons"; import { AntDesign, MaterialIcons } from "@expo/vector-icons";
import { import {
router, router,
@@ -23,7 +24,7 @@ import {
useLocalSearchParams, useLocalSearchParams,
} from "expo-router"; } from "expo-router";
import _ from "lodash"; import _ from "lodash";
import { useCallback, useState } from "react"; import { useCallback, useEffect, useState } from "react";
export default function InvestmentDetail() { export default function InvestmentDetail() {
const { user } = useAuth(); const { user } = useAuth();
@@ -62,6 +63,31 @@ export default function InvestmentDetail() {
setOpenDrawerPublish(false); setOpenDrawerPublish(false);
}; };
const [value, setValue] = useState({
sisa: 0,
reminder: false,
});
useEffect(() => {
updateCountDown();
}, [data]);
console.log("[DATA DETAIL]", JSON.stringify(data, null, 2));
const updateCountDown = () => {
const countDown = countDownAndCondition({
duration: data?.MasterPencarianInvestor.name,
publishTime: data?.countDown,
});
setValue({
sisa: countDown.durationDay,
reminder: countDown.reminder,
});
};
const bottomSection = ( const bottomSection = (
<Invesment_ComponentBoxOnBottomDetail <Invesment_ComponentBoxOnBottomDetail
id={id as string} id={id as string}
@@ -71,7 +97,7 @@ export default function InvestmentDetail() {
); );
const buttonSection = ( const buttonSection = (
<Investment_ButtonInvestasiSection id={id as string} isMine={user?.id === data?.author?.id} /> <Investment_ButtonInvestasiSection id={id as string} isMine={user?.id === data?.author?.id} reminder={value.reminder} />
); );
return ( return (

View File

@@ -6,6 +6,7 @@ import {
TextCustom, TextCustom,
ViewWrapper, ViewWrapper,
} from "@/components"; } from "@/components";
import { useAuth } from "@/hooks/use-auth";
import Voting_BoxPublishSection from "@/screens/Voting/BoxPublishSection"; import Voting_BoxPublishSection from "@/screens/Voting/BoxPublishSection";
import { apiVotingGetAll } from "@/service/api-client/api-voting"; import { apiVotingGetAll } from "@/service/api-client/api-voting";
import { router, useFocusEffect } from "expo-router"; import { router, useFocusEffect } from "expo-router";
@@ -13,6 +14,7 @@ import _ from "lodash";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
export default function VotingBeranda() { export default function VotingBeranda() {
const { user } = useAuth();
const [listData, setListData] = useState<any>([]); const [listData, setListData] = useState<any>([]);
const [loadingGetData, setLoadingGetData] = useState(false); const [loadingGetData, setLoadingGetData] = useState(false);
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
@@ -29,6 +31,7 @@ export default function VotingBeranda() {
const response = await apiVotingGetAll({ const response = await apiVotingGetAll({
search, search,
category: "beranda", category: "beranda",
userLoginId: user?.id,
}); });
if (response.success) { if (response.success) {
setListData(response.data); setListData(response.data);

View File

@@ -4,6 +4,7 @@ import {
ButtonCenteredOnly, ButtonCenteredOnly,
ButtonCustom, ButtonCustom,
InformationBox, InformationBox,
NewWrapper,
StackCustom, StackCustom,
ViewWrapper, ViewWrapper,
} from "@/components"; } from "@/components";
@@ -12,6 +13,7 @@ import { useAuth } from "@/hooks/use-auth";
import { apiUser } from "@/service/api-client/api-user"; import { apiUser } from "@/service/api-client/api-user";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { router } from "expo-router"; import { router } from "expo-router";
import { RefreshControl } from "react-native";
import Toast from "react-native-toast-message"; import Toast from "react-native-toast-message";
export default function WaitingRoom() { export default function WaitingRoom() {
@@ -33,7 +35,7 @@ export default function WaitingRoom() {
} else { } else {
Toast.show({ Toast.show({
type: "success", type: "success",
text1: "Akun anda telah aktif", // text2: "Anda berhasil login", text1: "Selamat ! Akun anda telah aktif", // text2: "Anda berhasil login",
}); });
router.replace(`/(application)/(user)/profile/create`); router.replace(`/(application)/(user)/profile/create`);
} }
@@ -82,10 +84,18 @@ export default function WaitingRoom() {
return ( return (
<> <>
<ViewWrapper footerComponent={logoutButton()}> <NewWrapper
footerComponent={logoutButton()}
refreshControl={
<RefreshControl refreshing={isLoading} onRefresh={handleCheck} />
}
>
<StackCustom> <StackCustom>
<InformationBox text="Permohonan akses Anda sedang dalam proses verifikasi oleh admin. Harap tunggu, Anda akan menerima pemberitahuan melalui Whatsapp setelah disetujui." /> <InformationBox
<ButtonCenteredOnly text="Akun Anda sedang menunggu aktivasi.
Silakan tunggu beberapa saat. Untuk memperbarui status, tarik layar ke bawah."
/>
{/* <ButtonCenteredOnly
isLoading={isLoading} isLoading={isLoading}
onPress={() => { onPress={() => {
handleCheck(); handleCheck();
@@ -93,9 +103,9 @@ export default function WaitingRoom() {
icon="refresh-ccw" icon="refresh-ccw"
> >
Check Check
</ButtonCenteredOnly> </ButtonCenteredOnly> */}
</StackCustom> </StackCustom>
</ViewWrapper> </NewWrapper>
</> </>
); );
} }

View File

@@ -74,7 +74,7 @@ export default function TermsAgreement() {
<> <>
<Stack.Screen <Stack.Screen
options={{ options={{
title: "Terms Agreement", title: "Terms & Conditions",
}} }}
/> />
<ViewWrapper footerComponent={footerComponent}> <ViewWrapper footerComponent={footerComponent}>
@@ -87,6 +87,7 @@ export default function TermsAgreement() {
alignItems: "center", alignItems: "center",
marginTop: 16, marginTop: 16,
marginBottom: 16, marginBottom: 16,
paddingInline: 10,
}} }}
> >
<CheckboxCustom value={term} onChange={() => setTerm(!term)} /> <CheckboxCustom value={term} onChange={() => setTerm(!term)} />

View File

@@ -73,7 +73,22 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
setIsLoading(true); setIsLoading(true);
try { try {
const response = await apiLogin({ nomor: nomor }); const response = await apiLogin({ nomor: nomor });
await AsyncStorage.setItem("kode_otp", response.kodeId); console.log("[RESPONSE AUTH]", JSON.stringify(response));
if (response.success) {
Toast.show({
type: "success",
text1: "Sukses",
text2: "Kode OTP berhasil dikirim",
});
await AsyncStorage.setItem("kode_otp", response.kodeId);
router.replace(`/verification?nomor=${nomor}`);
return;
} else {
router.replace(`/register?nomor=${nomor}`);
return;
}
} catch (error: any) { } catch (error: any) {
throw new Error(error.response?.data?.message || "Gagal kirim OTP"); throw new Error(error.response?.data?.message || "Gagal kirim OTP");
} finally { } finally {
@@ -81,13 +96,26 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
} }
}; };
// const loginWithNomor = async (nomor: string) => {
// setIsLoading(true);
// try {
// const response = await apiLogin({ nomor: nomor });
// await AsyncStorage.setItem("kode_otp", response.kodeId);
// } catch (error: any) {
// throw new Error(error.response?.data?.message || "Gagal kirim OTP");
// } finally {
// setIsLoading(false);
// }
// };
// --- 2. Validasi OTP & cek user --- // --- 2. Validasi OTP & cek user ---
const validateOtp = async (nomor: string) => { const validateOtp = async (nomor: string) => {
try { try {
setIsLoading(true); setIsLoading(true);
const response = await apiValidationCode({ nomor: nomor }); const response = await apiValidationCode({ nomor: nomor });
const { token } = response; const { token } = response;
console.log("[RESPONSE VALIDASI OTP]", JSON.stringify(response, null, 2));
if (response.success) { if (response.success) {
setToken(token); setToken(token);
await AsyncStorage.setItem("authToken", token); await AsyncStorage.setItem("authToken", token);
@@ -104,20 +132,23 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
if (response.active) { if (response.active) {
if (response.roleId === "1") { if (response.roleId === "1") {
return "/(application)/(user)/home"; router.replace("/(application)/(user)/home");
return;
} else { } else {
return "/(application)/admin/dashboard"; router.replace("/(application)/admin/dashboard");
return;
} }
} else { } else {
return "/(application)/(user)/waiting-room"; router.replace("/(application)/(user)/waiting-room");
return;
} }
} else { } else {
Toast.show({ Toast.show({
type: "info", type: "info",
text1: "Anda belum terdaftar", text1: "Terjadi kesalahan",
text2: "Silahkan daftar terlebih dahulu", text2: "Silahkan coba lagi",
}); });
return `/register?nomor=${nomor}`; return;
} }
} catch (error: any) { } catch (error: any) {
console.log("Error validasi otp >>", (error as Error).message || error); console.log("Error validasi otp >>", (error as Error).message || error);
@@ -132,6 +163,10 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
// --- 3. Ambil data user --- // --- 3. Ambil data user ---
const userData = async (token: string) => { const userData = async (token: string) => {
try { try {
if (!token) {
throw new Error("Token tidak ditemukan");
}
setIsLoading(true); setIsLoading(true);
const response = await apiConfig.get(`/mobile?token=${token}`, { const response = await apiConfig.get(`/mobile?token=${token}`, {
headers: { headers: {
@@ -145,7 +180,10 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
await AsyncStorage.setItem("userData", JSON.stringify(dataUser)); await AsyncStorage.setItem("userData", JSON.stringify(dataUser));
return dataUser; return dataUser;
} catch (error: any) { } catch (error: any) {
console.log("[LOAD USER DATA]",error.response?.data?.message + "user" || "Gagal mengambil data user"); console.log(
"[LOAD USER DATA]",
error.response?.data?.message + "user" || "Gagal mengambil data user"
);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }
@@ -160,9 +198,8 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
setIsLoading(true); setIsLoading(true);
try { try {
const response = await apiRegister({ data: userData }); const response = await apiRegister({ data: userData });
console.log("response", response); console.log("[REGISTER FETCH]", JSON.stringify(response, null, 2));
const { token } = response;
if (!response.success) { if (!response.success) {
Toast.show({ Toast.show({
type: "info", type: "info",
@@ -173,23 +210,63 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
return; return;
} }
setToken(token);
await AsyncStorage.setItem("authToken", token);
Toast.show({ Toast.show({
type: "success", type: "success",
text1: "Sukses", text1: "Sukses",
text2: "Anda berhasil terdaftar", text2: "Anda berhasil terdaftar",
}); });
router.replace("/(application)/(user)/waiting-room"); router.replace(`/verification?nomor=${userData.nomor}`);
return; return;
} catch (error: any) { } catch (error: any) {
Toast.show({
type: "error",
text1: "Error",
text2: error.response?.data?.message || "Gagal mendaftar",
});
console.log("Error register", error); console.log("Error register", error);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }
}; };
// const registerUser = async (userData: {
// username: string;
// nomor: string;
// termsOfServiceAccepted: boolean;
// }) => {
// setIsLoading(true);
// try {
// const response = await apiRegister({ data: userData });
// console.log("response", response);
// const { token } = response;
// if (!response.success) {
// Toast.show({
// type: "info",
// text1: "Info",
// text2: response.message,
// });
// return;
// }
// setToken(token);
// await AsyncStorage.setItem("authToken", token);
// Toast.show({
// type: "success",
// text1: "Sukses",
// text2: "Anda berhasil terdaftar",
// });
// router.replace("/(application)/(user)/waiting-room");
// return;
// } catch (error: any) {
// console.log("Error register", error);
// } finally {
// setIsLoading(false);
// }
// };
// --- 5. Logout --- // --- 5. Logout ---
const logout = async () => { const logout = async () => {
try { try {
setIsLoading(true); setIsLoading(true);

View File

@@ -422,7 +422,7 @@
); );
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile"; PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
PRODUCT_NAME = HIPMIBadungConnect; PRODUCT_NAME = "HIPMIBadungConnect";
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -454,7 +454,7 @@
); );
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile"; PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
PRODUCT_NAME = HIPMIBadungConnect; PRODUCT_NAME = "HIPMIBadungConnect";
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";

View File

@@ -39,7 +39,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>9</string> <string>10</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>

View File

@@ -72,20 +72,11 @@ export default function LoginView() {
const realNumber = callingCode + fixNumber; const realNumber = callingCode + fixNumber;
console.log("[REALNUMBER]", realNumber);
try { try {
setLoading(true); setLoading(true);
// const response = await apiLogin({ nomor: realNumber }); const response = await loginWithNomor(realNumber);
await loginWithNomor(realNumber); console.log("[RESPONSE UI]", response);
Toast.show({
type: "success",
text1: "Sukses",
text2: "Kode OTP berhasil dikirim",
});
router.navigate(`/verification?nomor=${realNumber}`);
} catch (error) { } catch (error) {
console.log("Error login", error); console.log("Error login", error);
Toast.show({ Toast.show({
@@ -96,6 +87,30 @@ export default function LoginView() {
} finally { } finally {
setLoading(false); setLoading(false);
} }
// try {
// setLoading(true);
// // const response = await apiLogin({ nomor: realNumber });
// const response = await loginWithNomor(realNumber);
// console.log("[RESPONSE]", response);
// Toast.show({
// type: "success",
// text1: "Sukses",
// text2: "Kode OTP berhasil dikirim",
// });
// // router.navigate(`/verification?nomor=${realNumber}`);
// } catch (error) {
// console.log("Error login", error);
// Toast.show({
// type: "error",
// text1: "Error",
// text2: error as string,
// });
// } finally {
// setLoading(false);
// }
} }
if (token && token !== "" && !isUserActive) { if (token && token !== "" && !isUserActive) {

View File

@@ -89,8 +89,9 @@ export default function VerificationView() {
// ✅ VERIFIKASI OTOMATIS UNTUK APPLE REVIEW // ✅ VERIFIKASI OTOMATIS UNTUK APPLE REVIEW
if (inputOtp === "1234") { if (inputOtp === "1234") {
try { try {
const response = await validateOtp(nomor as string); await validateOtp(nomor as string);
router.replace(response);
return;
} catch (error) { } catch (error) {
console.log("Error verification", error); console.log("Error verification", error);
Toast.show({ type: "error", text1: "Gagal verifikasi" }); Toast.show({ type: "error", text1: "Gagal verifikasi" });
@@ -103,16 +104,8 @@ export default function VerificationView() {
// 🔁 VERIFIKASI NORMAL (untuk pengguna sungguhan) // 🔁 VERIFIKASI NORMAL (untuk pengguna sungguhan)
try { try {
const response = await validateOtp(nomor as string); await validateOtp(nomor as string);
// registerForPushNotificationsAsync().then((token) => { return
// if (token) {
// console.log("Expo Push Token:", token);
// // TODO: Kirim token ke backend kamu
// } else {
// console.log("Failed to get Expo Push Token");
// }
// });
router.replace(response);
} catch (error) { } catch (error) {
console.log("Error verification", error); console.log("Error verification", error);
Toast.show({ type: "error", text1: "Gagal verifikasi" }); Toast.show({ type: "error", text1: "Gagal verifikasi" });

View File

@@ -15,7 +15,7 @@ export default function Home_FeatureSection() {
name: "Collaboration", name: "Collaboration",
icon: <Ionicons name="share" size={48} color="gray" />, icon: <Ionicons name="share" size={48} color="gray" />,
onPress: () => router.push("/(application)/(user)/collaboration/(tabs)"), onPress: () => router.push("/(application)/(user)/collaboration/(tabs)"),
status: "active", status: "inactive",
}, },
{ {
name: "Voting", name: "Voting",

View File

@@ -1,12 +1,13 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { import {
BaseBox, BaseBox,
Grid, Grid,
ProgressCustom, ProgressCustom,
StackCustom, StackCustom,
TextCustom, TextCustom,
} from "@/components"; } from "@/components";
import API_STRORAGE from "@/constants/base-url-api-strorage"; import API_STRORAGE from "@/constants/base-url-api-strorage";
import { MainColor } from "@/constants/color-palet";
import DUMMY_IMAGE from "@/constants/dummy-image-value"; import DUMMY_IMAGE from "@/constants/dummy-image-value";
import { countDownAndCondition } from "@/utils/countDownAndCondition"; import { countDownAndCondition } from "@/utils/countDownAndCondition";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
@@ -21,7 +22,7 @@ export default function Investment_BoxBerandaSection({
id: string; id: string;
data: any; data: any;
}) { }) {
// console.log("[DATA By one]", JSON.stringify(data, null, 2)); // console.log("[DATA By one]", JSON.stringify(data, null, 2));
const [value, setValue] = useState({ const [value, setValue] = useState({
sisa: 0, sisa: 0,
@@ -32,6 +33,8 @@ export default function Investment_BoxBerandaSection({
updateCountDown(); updateCountDown();
}, [data]); }, [data]);
console.log("[DATA BERANDA]", JSON.stringify(data, null, 2));
const updateCountDown = () => { const updateCountDown = () => {
const countDown = countDownAndCondition({ const countDown = countDownAndCondition({
duration: data?.pencarianInvestor, duration: data?.pencarianInvestor,
@@ -66,8 +69,10 @@ export default function Investment_BoxBerandaSection({
<TextCustom truncate={2}>{data.title}</TextCustom> <TextCustom truncate={2}>{data.title}</TextCustom>
<ProgressCustom <ProgressCustom
label={`${data.progress}%`} label={`${data.progress}%`}
value={data.progress} value={Number(data.progress)}
size="lg" size="lg"
animated
color="primary"
/> />
{value.reminder ? ( {value.reminder ? (
<View <View
@@ -79,13 +84,11 @@ export default function Investment_BoxBerandaSection({
> >
<Ionicons name="alert-circle-outline" size={16} color="red" /> <Ionicons name="alert-circle-outline" size={16} color="red" />
<TextCustom truncate color="red" size="small"> <TextCustom truncate color="red" size="small">
Periode Investasi Berakhir Periode Berakhir
</TextCustom> </TextCustom>
</View> </View>
) : ( ) : (
<TextCustom> <TextCustom>Sisa waktu: {value.sisa} hari</TextCustom>
Sisa waktu: {value.sisa} hari
</TextCustom>
)} )}
</StackCustom> </StackCustom>
</Grid.Col> </Grid.Col>

View File

@@ -4,9 +4,11 @@ import { router } from "expo-router";
export default function Investment_ButtonInvestasiSection({ export default function Investment_ButtonInvestasiSection({
id, id,
isMine, isMine,
reminder,
}: { }: {
id: string; id: string;
isMine: boolean; isMine: boolean;
reminder: boolean;
}) { }) {
return ( return (
<> <>
@@ -14,11 +16,12 @@ export default function Investment_ButtonInvestasiSection({
<ButtonCustom disabled>Investasi ini milik Anda</ButtonCustom> <ButtonCustom disabled>Investasi ini milik Anda</ButtonCustom>
) : ( ) : (
<ButtonCustom <ButtonCustom
disabled={reminder}
onPress={() => { onPress={() => {
router.navigate(`/investment/${id}/(transaction-flow)`); router.navigate(`/investment/${id}/(transaction-flow)`);
}} }}
> >
Beli Saham {reminder ? "Periode Investasi Berakhir" : "Beli Saham"}
</ButtonCustom> </ButtonCustom>
)} )}
</> </>

View File

@@ -52,7 +52,7 @@ export default function Invesment_DetailDataPublishSection({
<ReportBox text={data?.catatan} /> <ReportBox text={data?.catatan} />
)} )}
<Invesment_BoxProgressSection <Invesment_BoxProgressSection
progress={data?.progress} progress={Number(data?.progress)}
status={status as string} status={status as string}
/> />
<Invesment_BoxDetailDataSection <Invesment_BoxDetailDataSection

View File

@@ -79,12 +79,14 @@ export async function apiVotingUpdateData({
} }
} }
export async function apiVotingGetAll({ search, category, authorId }: { search?: string, category: "beranda" | "contribution" | "all-history" | "my-history", authorId?: string }) { export async function apiVotingGetAll({ search, category, authorId, userLoginId }: { search?: string, category: "beranda" | "contribution" | "all-history" | "my-history", authorId?: string, userLoginId?: string }) {
try { try {
console.log("userLoginId", userLoginId);
const categoryQuery = category ? `?category=${category}` : ""; const categoryQuery = category ? `?category=${category}` : "";
const searchQuery = search ? `&search=${search}` : ""; const searchQuery = search ? `&search=${search}` : "";
const authorIdQuery = authorId ? `&authorId=${authorId}` : ""; const authorIdQuery = authorId ? `&authorId=${authorId}` : "";
const response = await apiConfig.get(`/mobile/voting${categoryQuery}${searchQuery}${authorIdQuery}`); const userLoginIdQuery = userLoginId ? `&userLoginId=${userLoginId}` : "";
const response = await apiConfig.get(`/mobile/voting${categoryQuery}${searchQuery}${authorIdQuery}${userLoginIdQuery}`);
return response.data; return response.data;
} catch (error) { } catch (error) {
throw error; throw error;

View File

@@ -20,7 +20,6 @@ apiConfig.interceptors.request.use(
config.headers.Authorization = `Bearer ${token}`; config.headers.Authorization = `Bearer ${token}`;
} }
// console.log("config", JSON.stringify(config, null, 2));
return config; return config;
}, },
(error) => { (error) => {
@@ -29,16 +28,15 @@ apiConfig.interceptors.request.use(
); );
export async function apiVersion() { export async function apiVersion() {
// console.log("API_BASE_URL", API_BASE_URL);
const response = await apiConfig.get("/version"); const response = await apiConfig.get("/version");
return response.data; return response.data;
} }
export async function apiLogin({ nomor }: { nomor: string }) { export async function apiLogin({ nomor }: { nomor: string }) {
const response = await apiConfig.post("/auth/login", { const response = await apiConfig.post("/mobile/auth/login", {
nomor: nomor, nomor: nomor,
}); });
return response.data; return response.data;;
} }
export async function apiCheckCodeOtp({ kodeId }: { kodeId: string }) { export async function apiCheckCodeOtp({ kodeId }: { kodeId: string }) {
@@ -58,7 +56,7 @@ export async function apiRegister({
}: { }: {
data: { nomor: string; username: string; termsOfServiceAccepted: boolean }; data: { nomor: string; username: string; termsOfServiceAccepted: boolean };
}) { }) {
const response = await apiConfig.post(`/auth/register`, { const response = await apiConfig.post(`/mobile/auth/register`, {
data: data, data: data,
}); });
return response.data; return response.data;