Skip to content

Commit

Permalink
🔨 BASE #270 melhorando metodo
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Sep 27, 2022
1 parent 5a335d9 commit d33012e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion appexemplo_v2.0/api/api_controllers/TGenericAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ public function __construct()
{
}

public static function getBodyJson($msg, Response $response)
public static function getBodyJson($msg, Response $response,$status=200)
{
$status = empty($status)?200:$status;
$msgJson = json_encode($msg);
$response->withStatus( $status );
$response->getBody()->write( $msgJson );
return $response->withHeader('Content-Type', 'application/json');
}
Expand Down

0 comments on commit d33012e

Please sign in to comment.