Order-Change-Address

This commit is contained in:
mhmj
2019-05-28 14:46:27 +08:00
parent 7c69c74f98
commit 52c1093d2d
5 changed files with 5 additions and 64 deletions
@@ -1,14 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: mhmj
* Date: 28/05/2019
* Time: 10:51 AM
*/
namespace App\Classes\Modules\ControllersLogic\Orders;
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
use App\Classes\Modules\Orders\DataTransferObjects\AddressObject;
use App\Classes\Modules\Orders\Services\UpdatesOrderAddress;
@@ -32,10 +25,9 @@ class UpdateOrderAddressLogic
public function execute(string $orderId, Request $request){
try{
$addressObject = new AddressObject($request->address_id);
return $this->UpdatesOrderAddress->execute($orderId,$addressObject);
return new JsonResponse([],HttpStatus::RESOURCE_CREATED);
return $this->UpdatesOrderAddress->execute($orderId,$request->address_id);
return new JsonResponse([],HttpStatus::REQUEST_ACCEPTED);
} catch (\Exception $exception) {
throw new InternalServerErrorException("Failed to update address because{$exception->getMessage()}");