mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Fix routes
This commit is contained in:
@@ -39,6 +39,8 @@ class ShowController extends Controller
|
||||
public function show(Account $account): JsonResponse
|
||||
{
|
||||
$transformer = new AccountTransformer;
|
||||
return response()->json($this->jsonApiObject('accounts', $account, $transformer));
|
||||
return response()
|
||||
->api($this->jsonApiObject('accounts', $account, $transformer))
|
||||
->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ class NetWorthController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
@@ -52,13 +53,17 @@ class NetWorthController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SingleDateRequest $request
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function get(SingleDateRequest $request): JsonResponse
|
||||
{
|
||||
$date = $request->getDate();
|
||||
$result = $this->netWorth->sumNetWorthByCurrency($date);
|
||||
$converted = $this->cerSum($result);
|
||||
|
||||
return response()->json($converted);
|
||||
return response()->api($converted);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user