From d9c85a78141e74dca5727ecf9d5885a051dc4c47 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Mon, 28 Mar 2022 14:13:41 +0100 Subject: [PATCH] Add Nano Health , password_validation in response payload when show agent wallet --- app/Http/Controllers/WalletController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/WalletController.php b/app/Http/Controllers/WalletController.php index ba7a0af..7b67722 100755 --- a/app/Http/Controllers/WalletController.php +++ b/app/Http/Controllers/WalletController.php @@ -83,9 +83,14 @@ class WalletController extends Controller c.currency_code , cw.id_network , cw.has_nano_credit , cG.category FROM wallet_agent wa INNER JOIN configWallet cw ON wa.network_id = cw.id_network INNER JOIN networks n ON n.id = wa.network_id INNER JOIN countries_currencies c ON c.id = n.country_id INNER JOIN networks_agents na on na.id = wa.networks_agent_id INNER JOIN codeGenerer cG on na.codeGenerer_id = cG.id WHERE wa.wallet_id = :id', ['id' => $id_wallet]))->first(); - if ($wallet) + if ($wallet) { + // Recuperer la config du nano santé + $nhConfig = collect(DB::select('SELECT * FROM nh_networks_configs WHERE network_id = :network_id LIMIT 50', ['network_id' => $wallet->id_network]))->first(); + if (isset($nhConfig)) { + $wallet->password_validation = $nhConfig->password_validation ?? "MAX"; + } return $this->successResponse($wallet); - else + } else return $this->errorResponse(trans('errors.model_not_found', ['model' => 'wallet']), Response::HTTP_BAD_REQUEST); }