diff --git a/src/components/CardsPengadaanInvestor/CardsPengadaanInvestor.js b/src/components/CardsPengadaanInvestor/CardsPengadaanInvestor.js index 9d7ebed827bfe7d11bb0f4b16dd8da314586c4e1..d1c7101595359a7e7c477d5a072e10abccd438f1 100644 --- a/src/components/CardsPengadaanInvestor/CardsPengadaanInvestor.js +++ b/src/components/CardsPengadaanInvestor/CardsPengadaanInvestor.js @@ -1,7 +1,7 @@ import React from 'react'; import './CardsPengadaanInvestor.css'; import emptyIcon from './empty.svg'; -import { Link, Redirect } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import { Row } from "react-bootstrap"; const CardsPengadaanInvestor = ({ posts, loading }) => { @@ -20,7 +20,7 @@ const CardsPengadaanInvestor = ({ posts, loading }) => { <img src={ item.pengadaan.toko.fotoProfilToko } className="owned-pengadaan-profil-img" alt=""></img> <div className="owned-pengadaan-store-name"> { item.pengadaan.toko.namaToko }<br /> - <span style={{ fontWeight: "500", fontSize: "14px" }}>WKD-02ID2021 - {item.pengadaan.toko.namaCabang}</span> + <span style={{ fontWeight: "500", fontSize: "14px" }}>WKD-{item.pengadaan.pk}-{item.pengadaan.toko.namaCabang}</span> </div> </div> <div className="owned-pengadaan-profil-right" style={{color: (item.pengadaan.daftarMainan.some(mainan => mainan.status == 'RSK') ? 'red' : "#146A5F") }}> diff --git a/src/page/ListOwnedPengadaan/ListOwnedPengadaan.js b/src/page/ListOwnedPengadaan/ListOwnedPengadaan.js index a36d63df0d01c6500d242a39908d0bd618ac78b7..f973a355f591ba69887d8dc7cc00f25fd1413503 100644 --- a/src/page/ListOwnedPengadaan/ListOwnedPengadaan.js +++ b/src/page/ListOwnedPengadaan/ListOwnedPengadaan.js @@ -129,7 +129,7 @@ const ListOwnedPengadaan = ({ isAuthenticated, user }) => { if (investasiObj.data[i].pengadaan.danaTerkumpul === investasiObj.data[i].pengadaan.totalBiaya && investasiObj.data[i].pengadaan.statusProyek === "TRM") { resultSaham.push(investasiObj.data[i]); } - else { + else if (investasiObj.data[i].status === "TRM") { resultPengadaan.push(investasiObj.data[i]); } } diff --git a/src/page/MembuatInvestasi/MembuatInvestasi.js b/src/page/MembuatInvestasi/MembuatInvestasi.js index ee1b685c2a185b25789e2c082b28d11ad47d8b03..6ab5f596ef61b00e8f5fa9eb3c436a04004c6d8d 100644 --- a/src/page/MembuatInvestasi/MembuatInvestasi.js +++ b/src/page/MembuatInvestasi/MembuatInvestasi.js @@ -265,10 +265,11 @@ function postInvestasi(pk, nominal) { investasiFormData.append('pengadaan', pk); try { axios.post(`${process.env.REACT_APP_BACKEND_API_URL}/api/investasi/`, investasiFormData, config) - alert('Investasi berhasil. Mohon menunggu konfirmasi dari admin.'); - window.history.back(); - window.history.back(); - } catch (err) { + .then((response) => { + alert("Berhasil membuat investasi"); + }); + } + catch (err) { alert('Investasi gagal dibuat. Mohon coba kembali.'); } } else {