check status
This commit is contained in:
@@ -127,7 +127,8 @@ const UserProfileStatus: React.FC<UserProfileStatusProps> = ({
|
||||
}
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const response = await apiCall(PAY_ALL_URL, 'POST',{ groupIds: selectedGroupIds, payAllDue: true }, undefined, "Payment failed. Try again.") as any;
|
||||
const response = await apiCall(PAY_ALL_URL, 'POST',{ groupIds: selectedGroupIds }, undefined, "Payment failed. Try again.") as any;
|
||||
|
||||
console.log("-=-=-=-=-=-=-=-=-=-=-=",response)
|
||||
|
||||
// const response = await fetch(
|
||||
|
||||
@@ -80,7 +80,7 @@ const GroupDetails = () => {
|
||||
const [cycleDashboardData, setCycleDashboardData] = useState<any>();
|
||||
const [selectedCycleNumber, setSelectedCycleNumber] = useState(null);
|
||||
const [cycleItems, setCycleItems] = useState([]);
|
||||
const [selectedUser, setSelectedUser] = useState() as any
|
||||
const [selectedUser, setSelectedUser] = useState() as string | any;
|
||||
|
||||
|
||||
const group = {
|
||||
@@ -96,10 +96,10 @@ const GroupDetails = () => {
|
||||
|
||||
|
||||
const getPaymentStatus = async () => {
|
||||
const response = await apiCall(`${BASE_URL}payments/group/${group.id || route?.params?.groupId}/payment/paid`, 'GET') as { status: string; data?: { currentCycle: number, allPaid: boolean, selectedUser: any }; message?: string };
|
||||
console.log("paymentStatus", response.data?.selectedUser)
|
||||
const response = await apiCall(`${BASE_URL}payments/group/${group.id || route?.params?.groupId}/payment/paid`, 'GET') as { status: string; data?: { currentCycle: number, allPaid: boolean, selectedUser: string }; message?: string };
|
||||
console.log("paymentStatus", response.data)
|
||||
if (response.status === 'success') {
|
||||
setSelectedUser(response.data?.selectedUser);
|
||||
setSelectedUser(response.data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ const GroupDetails = () => {
|
||||
placeholder="Select a Cycle"
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
{selectedCycleData && cycleDashboardData && (
|
||||
<CycleDashboard data={{ ...cycleDashboardData, cycles: [selectedCycleData] }} />
|
||||
)}
|
||||
@@ -263,7 +263,7 @@ const GroupDetails = () => {
|
||||
))}
|
||||
|
||||
|
||||
{cycleDashboardData?.status === 'ACTIVE' && !payable?.hasPaid && (
|
||||
{cycleDashboardData?.status === 'ACTIVE' || cycleDashboardData?.status === 'DELAY' && !payable?.hasPaid && (
|
||||
<TouchableOpacity onPress={() => setOpenModal(true)} style={styles.button}>
|
||||
<Text style={styles.buttonText}>Contribute</Text>
|
||||
</TouchableOpacity>
|
||||
@@ -423,7 +423,7 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
floatingWinnerContainer: {
|
||||
position: 'absolute',
|
||||
bottom: 80,
|
||||
bottom: 80,
|
||||
alignSelf: 'center',
|
||||
backgroundColor: colors.pastelBlue,
|
||||
paddingHorizontal: 15,
|
||||
|
||||
Reference in New Issue
Block a user