forked from PrestaShop/ps_apiresources
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PrestaShop#36 from dylanDenizonPresta/update-module
EndPoint Update module
- Loading branch information
Showing
2 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PrestaShop\Module\APIResources\ApiPlatform\Resources\Module; | ||
|
||
use ApiPlatform\Metadata\ApiResource; | ||
use PrestaShop\PrestaShop\Core\Domain\Module\Command\UpgradeModuleCommand; | ||
use PrestaShop\PrestaShop\Core\Domain\Module\Query\GetModuleInfos; | ||
use PrestaShopBundle\ApiPlatform\Metadata\CQRSUpdate; | ||
|
||
#[ApiResource( | ||
operations: [ | ||
new CQRSUpdate( | ||
uriTemplate: '/module/{technicalName}/upgrade', | ||
CQRSCommand: UpgradeModuleCommand::class, | ||
CQRSQuery: GetModuleInfos::class, | ||
scopes: [ | ||
'module_write', | ||
], | ||
), | ||
], | ||
)] | ||
class UpgradeModule extends Module | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters