Skip to content

Commit

Permalink
not doing api_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ftrotter committed Oct 31, 2018
1 parent 301cd91 commit 1b481cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/Controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class ApiController implements ControllerInterface
public function show( ZermeloReport $report )
{
$presenter = new TabularPresenter( $report );
$presenter->setApiPrefix( api_prefix() );
$api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " );
$presenter->setApiPrefix( $api_prefix );
$presenter->setReportPath( config('zermelobladetabular.TABULAR_URI_PREFIX') );
$presenter->setSummaryPath( config('zermelobladetabular.SUMMARY_URI_PREFIX') );
$cache = new DatabaseCache( $report );
Expand All @@ -24,7 +25,8 @@ public function show( ZermeloReport $report )

public function prefix() : string
{
$prefix = api_prefix()."/".config('zermelobladetabular.TABULAR_URI_PREFIX', "" );
$api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " );
$prefix = $api_prefix."/".config('zermelobladetabular.TABULAR_URI_PREFIX', "" );
return $prefix;
}
}
3 changes: 2 additions & 1 deletion src/Controllers/SummaryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function show( ZermeloReport $report )

public function prefix() : string
{
$prefix = api_prefix()."/".config('zermelobladetabular.SUMMARY_URI_PREFIX', "" );
$api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " );
$prefix = $api_prefix."/".config('zermelobladetabular.SUMMARY_URI_PREFIX', "" );
return $prefix;
}
}
5 changes: 3 additions & 2 deletions src/Controllers/WebController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class WebController implements ControllerInterface
public function show( ZermeloReport $report )
{
$presenter = new TabularPresenter( $report );

$presenter->setApiPrefix( api_prefix() );

$api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " );
$presenter->setApiPrefix( $api_prefix );
$presenter->setReportPath( config('zermelobladetabular.TABULAR_URI_PREFIX', '') );
$presenter->setSummaryPath( config('zermelobladetabular.SUMMARY_URI_PREFIX', '') );

Expand Down

0 comments on commit 1b481cf

Please sign in to comment.