fipamo/app/Http/Controllers/API/InitAPIController.php
ro 0e6d4bd2b4
Case patch directory pathing
app was erroring out because classes in the upkeep directory could not
be found due to a case mix up where 'Upkeep' and 'UpKeep' were both
being used causing a path error because the actual directory is 'Upkeep.'
2024-08-30 16:14:15 -06:00

40 lines
1.1 KiB
PHP

<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Services\Upkeep\InitService;
use App\Services\Upkeep\ResetService;
class InitAPIController extends Controller
{
protected $init;
protected $reset;
public function __construct(InitService $initService, ResetService $resetService)
{
$this->init = $initService;
$this->reset = $resetService;
}
//init stuff
public function setupFresh(Request $request)
{
$result = $this->init->fresh(json_decode($request->getContent()));
return response()->json($result)->header('Content-Type', 'application/json');
}
public function setupRestore(Request $request)
{
$result = $this->init->restore($request);
return response()->json($result)->header('Content-Type', 'application/json');
}
public function setupReset(Request $request)
{
$result = $this->reset->site($request);
return response()->json($result)->header('Content-Type', 'application/json');
}
}