mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
create database seeder for the services for testing environment
This commit is contained in:
@@ -71,6 +71,7 @@ class UpdateSupplierCurrenciesLogic extends AbstractControllerLogic
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ResourceNotFoundException
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
@@ -87,17 +88,18 @@ class UpdateSupplierCurrenciesLogic extends AbstractControllerLogic
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
$constant = $this->fetchesConstant->execute(['supplier_currencies' => $supplierId]);
|
||||
$this->canUpdateConstant->passes($object);
|
||||
$this->updatesConstant->execute($constant, $object);
|
||||
|
||||
} catch (\Exception $exception) {
|
||||
} catch (ResourceNotFoundException $exception){
|
||||
$this->canCreateConstant->passes($object);
|
||||
$segment = $this->fetchesSegment->execute(['type' => SegmentConstants::STANDARD_SEGMENT]);
|
||||
$constant = $this->createsConstant->execute($segment, $object);
|
||||
$this->createsConstant->execute($segment, $object);
|
||||
}
|
||||
|
||||
return $this->resourceResponse(new ConstantResource($constant));
|
||||
return $this->response([]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user