mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-30 01:43:57 +00:00
Order-Change-Address
This commit is contained in:
@@ -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()}");
|
||||
|
||||
Reference in New Issue
Block a user