finish acceptance tests and refactor IotaCodesClient to service container

This commit is contained in:
Richard Morgan
2017-05-15 22:14:14 -04:00
parent 2c8c692890
commit e4e17dedc5
13 changed files with 338 additions and 24 deletions

View File

@@ -46,11 +46,9 @@ class FlightController extends Controller
$page
);
$result = (new Collection($paginator, new TripTransformer(), 'trips'))
$result = (new Collection($paginator, new FlightTransform(), 'trips'))
->setPaginator(new IlluminatePaginatorAdapter($paginator));
$result = new Collection($flightCollection, new FlightTransform(), 'flights');
return $this->JsonApiResponse($result, 200);
}
@@ -98,10 +96,10 @@ class FlightController extends Controller
{
/** @var \App\Libraries\Trips\Models\Flights $flight */
$flight = Flights::find($id);
$deleted = $flight->delete();
if (! is_null($flight)) {
$deleted = $flight->delete();
}
$result = new Item($flight, new FlightTransform(), 'flights');
return $this->JsonApiResponse($result, 200);
return response()->json(null, 204);
}
}