refactor(dashboard,history): replace ViewModels with Pinia stores and improve backend
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
namespace App\Features\History\Services;
|
||||
|
||||
use App\Contracts\PriceRepository;
|
||||
use App\Data\ElectricityData;
|
||||
use App\Data\GasData;
|
||||
use App\Features\History\Data\HistoryData;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -16,9 +14,12 @@ class HistoryService
|
||||
|
||||
public function getHistoryData(Carbon $date): HistoryData
|
||||
{
|
||||
$electricity = ElectricityData::collect($this->repository->retrieveElectricityForDate($date));
|
||||
$gas = GasData::collect($this->repository->retrieveGasForDate($date));
|
||||
$electricity = $this->repository->retrieveElectricityForDate($date);
|
||||
$gas = $this->repository->retrieveGasForDate($date);
|
||||
|
||||
return new HistoryData($electricity, $gas);
|
||||
return new HistoryData(
|
||||
electricity: $electricity,
|
||||
gas: $gas
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user