Skip to content

Commit

Permalink
no more api_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ftrotter committed Oct 31, 2018
1 parent ce7b115 commit f7338d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 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 CardPresenter( $report );
$presenter->setApiPrefix( api_prefix() );
$api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " );
$presenter->setApiPrefix( $api_prefix );
$presenter->setReportPath( config('zermelobladecard.TABULAR_URI_PREFIX') );
$presenter->setSummaryPath( config('zermelobladecard.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('zermelobladecard.TABULAR_URI_PREFIX', "" );
$api_prefix = trim( config("zermelo.URI_API_PREFIX"), "/ " );
$prefix = $api_prefix."/".config('zermelobladecard.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 @@ -18,7 +18,8 @@ public function show( ZermeloReport $report )

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

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

Expand Down

0 comments on commit f7338d6

Please sign in to comment.