Clean up v2 api points.

This commit is contained in:
James Cole
2023-10-29 06:09:21 +01:00
parent 4bb171128e
commit aa1a521cf0
7 changed files with 17 additions and 32 deletions

View File

@@ -59,18 +59,20 @@ class ShowController extends Controller
}
/**
* 2023-10-29 removed the cerSum reference, not sure where this is used atm
* so removed from api.php. Also applies to "spent" method.
*
* This endpoint is documented at:
* TODO add URL
*
*/
public function budgeted(DateRequest $request, Budget $budget): JsonResponse
{
throw new FireflyException('Needs refactoring, uses deprecated method.');
$data = $request->getAll();
$result = $this->repository->budgetedInPeriodForBudget($budget, $data['start'], $data['end']);
$converted = $this->cerSum(array_values($result));
//$converted = $this->cerSum(array_values($result));
return response()->json($converted);
return response()->json($result);
}
/**
@@ -80,11 +82,10 @@ class ShowController extends Controller
*/
public function spent(DateRequest $request, Budget $budget): JsonResponse
{
throw new FireflyException('Needs refactoring, uses deprecated method.');
$data = $request->getAll();
$result = $this->repository->spentInPeriodForBudget($budget, $data['start'], $data['end']);
$converted = $this->cerSum(array_values($result));
// $converted = $this->cerSum(array_values($result));
return response()->json($converted);
return response()->json($result);
}
}