Skip to content

Commit

Permalink
🔨 #270 atualizando metodos
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinaldo Araujo Barreto Junior committed Jul 6, 2022
1 parent 425f457 commit 2b8f905
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions appexemplo_v2.0/api/api_controllers/Meta_tipoAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public static function selectAll(Request $request, Response $response, array $ar
$msg = array( 'qtd'=> \CountHelper::count($result)
, 'result'=>$result
);
$response = $response->withJson($msg);
return $response;
$msgJson = json_encode($msg);
$response->getBody()->write( $msgJson );
return $response->withHeader('Content-Type', 'application/json');
}

//--------------------------------------------------------------------------------
Expand All @@ -52,8 +53,9 @@ public static function selectById(Request $request, Response $response, array $a
$msg = array( 'qtd'=> \CountHelper::count($result)
, 'result'=>$result
);
$response = $response->withJson($msg);
return $response;
$msgJson = json_encode($msg);
$response->getBody()->write( $msgJson );
return $response->withHeader('Content-Type', 'application/json');
}

//--------------------------------------------------------------------------------
Expand All @@ -73,8 +75,9 @@ public static function save(Request $request, Response $response, array $args)
$controller = new \Meta_tipo;
$controller->save($vo);

$response = $response->withJson($msg);
return $response;
$msgJson = json_encode($msg);
$response->getBody()->write( $msgJson );
return $response->withHeader('Content-Type', 'application/json');
}

//--------------------------------------------------------------------------------
Expand All @@ -83,7 +86,8 @@ public static function delete(Request $request, Response $response, array $args)
$id = $args['id'];
$controller = new \Meta_tipo;
$msg = $controller->delete($id);
$response = $response->withJson($msg);
return $response;
$msgJson = json_encode($msg);
$response->getBody()->write( $msgJson );
return $response->withHeader('Content-Type', 'application/json');
}
}

0 comments on commit 2b8f905

Please sign in to comment.