diff --git a/app/Http/Controllers/Frontend/DashboardController.php b/app/Http/Controllers/Frontend/DashboardController.php index 4b8e92d..7c532cb 100644 --- a/app/Http/Controllers/Frontend/DashboardController.php +++ b/app/Http/Controllers/Frontend/DashboardController.php @@ -56,7 +56,7 @@ class DashboardController extends Controller public function getMarketplaceAIFSellerData() { - $id = auth()->guard('users')->user()->id; + $id = auth()->guard('users')->user()->id ?? request()->user()->id; // $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_aif_sellers'])->get(); // foreach ($market_place_data as $row) { // $row['marketplace_aif_sellers_data'] = MarketplaceAlternativeInvestmentFundSeller::where('id', $row->associated_id)->first(); @@ -81,7 +81,7 @@ class DashboardController extends Controller ->join('marketplace_aif_sellers', 'marketplace_buyer_forms.associated_id', 'marketplace_aif_sellers.id') ->alernativeInvestmentFund() ->sold() - // ->where('listing_status', '!=', 'Hide') + ->where('listing_status', '!=', 'Hide') ->select('name_of_the_aif_fund', 'fund_category', 'fund_strategy', 'type_of_fund', 'total_capital_commitment', 'uncalled_capital_commitment') ->get(); return $data; @@ -113,7 +113,7 @@ class DashboardController extends Controller public function getMarketplaceFRESellerData() { - $id = auth()->guard('users')->user()->id; + $id = auth()->guard('users')->user()->id ?? request()->user()->id; // $market_place_data = MarketplaceBuyerForm::where(['users_id' => $id, 'status' => 'Sold', 'table' => 'marketplace_fre_sellers'])->get(); // foreach ($market_place_data as $row) { // $row['marketplace_fre_sellers_data'] = MarketplaceFractionalRealEstateSeller::where('id', $row->associated_id)->first(); diff --git a/app/Http/Controllers/Frontend/MarketPlaceController.php b/app/Http/Controllers/Frontend/MarketPlaceController.php index 378150a..a57604a 100644 --- a/app/Http/Controllers/Frontend/MarketPlaceController.php +++ b/app/Http/Controllers/Frontend/MarketPlaceController.php @@ -71,6 +71,11 @@ class MarketPlaceController extends Controller array_push($marketplaceListed, $aifMarketplace); array_push($marketplaceListed, $opMarketplace); + // $marketplaceListed = []; + + + + return [ 'data' => $marketplaceListed ]; diff --git a/routes/api.php b/routes/api.php index 301b6c3..8b391f1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -204,8 +204,10 @@ Route::group(['middleware' => ['auth:sanctum']], function () { Route::get("aif-investment-bought", [DashboardController::class, 'aifSoldInvestmentWatchlist']); Route::get("fre-investment-bought", [DashboardController::class, 'freSoldInvestmentWatchlist']); Route::get("op-investment-bought", [DashboardController::class, 'opSoldInvestmentWatchlist']); - Route::get("aif-investment-sold", [DashboardController::class, 'aifSoldInvestment']); - Route::get("fre-investment-sold", [DashboardController::class, 'freSoldInvestment']); + // Route::get("aif-investment-sold", [DashboardController::class, 'aifSoldInvestment']); + // Route::get("fre-investment-sold", [DashboardController::class, 'freSoldInvestment']); + Route::get("aif-investment-sold", [DashboardController::class, 'getMarketplaceAIFSellerData']); + Route::get("fre-investment-sold", [DashboardController::class, 'getMarketplaceFRESellerData']); Route::get("op-investment-sold", [DashboardController::class, 'opSoldInvestment']); Route::get("seller-form/{custom_id?}", [DashboardController::class, 'getSellerForm']); Route::post("marketplace/seller-form", [DashboardController::class, 'sellerFormSubmitAPI']);