Skip to content

Commit

Permalink
Merge pull request #465 from bitbager/master
Browse files Browse the repository at this point in the history
Remove unused get parameters
  • Loading branch information
bitbager authored Jan 30, 2023
2 parents 05b8cdb + bc90cca commit f94920a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
9 changes: 7 additions & 2 deletions src/Controller/Action/Admin/RetrievePackageInfoAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

namespace BitBag\SyliusCmsPlugin\Controller\Action\Admin;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

final class RetrievePackageInfoAction
{
public function __invoke(): Response
public function __invoke(Request $request): Response
{
try {
file_get_contents('https://intranet.bitbag.shop/retrieve-package-info?packageName="bitbag/cms-plugin"');
file_get_contents(\sprintf(
"https://intranet.bitbag.shop/retrieve-package-info?packageName='%s'&url='%s'",
'bitbag/cms-plugin',
\sprintf('%s://%s', $request->getScheme(), $request->getHttpHost())
));
} catch (\Exception $exception) {
return new Response('', Response::HTTP_BAD_REQUEST);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ sylius_ui:
sylius.admin.layout.javascripts:
blocks:
version_script:
template: "@BitBagSyliusCmsPlugin/Asset/_versionScript.html.twig"
priority: 10
template: "@BitBagSyliusCmsPlugin/Asset/_cmsVersionScript.html.twig"
priority: 30
2 changes: 1 addition & 1 deletion src/Resources/config/routing/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bitbag_sylius_cms_plugin_admin_upload_editor_image:
_controller: bitbag_sylius_cms_plugin.controller.action.admin.upload_editor_image

bitbag_sylius_cms_plugin_admin_retrieve_package_info:
path: /retrieve-package-info
path: /cms/retrieve-package-info
methods: [GET]
defaults:
_controller: bitbag_sylius_cms_plugin.controller.action.admin.retrieve_package_info
3 changes: 3 additions & 0 deletions src/Resources/views/Asset/_cmsVersionScript.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
fetch( "/admin/cms/retrieve-package-info");
</script>
5 changes: 0 additions & 5 deletions src/Resources/views/Asset/_versionScript.html.twig

This file was deleted.

0 comments on commit f94920a

Please sign in to comment.