From d28376c532402ad404c260f380be3712a47e65d8 Mon Sep 17 00:00:00 2001 From: Bjverde Date: Sat, 24 Sep 2022 00:29:20 -0300 Subject: [PATCH] =?UTF-8?q?:memo:=20APP=20#270=20corre=C3=A7=C3=A3o=20exem?= =?UTF-8?q?plo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/api_controllers/Acesso_perfilAPI.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php index 2189a852..28440725 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php @@ -63,13 +63,16 @@ public static function save(Request $request, Response $response, array $args) { $vo = new \Acesso_perfilVO; $msg = \Message::GENERIC_INSERT; - if($request->isPut()){ + if($request->getMethod() == 'PUT'){ $msg = \Message::GENERIC_UPDATE; $result = self::selectByIdInside($args); $bodyRequest = $result[0]; $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); } $bodyRequest = json_decode($request->getBody(),true); + if(empty($bodyRequest)){ + $bodyRequest = $request->getParsedBody(); + } $vo = \FormDinHelper::setPropertyVo($bodyRequest,$vo); $controller = new \Acesso_perfil;