diff --git a/Controller/ApiAddressAttributeController.php b/Controller/ApiAddressAttributeController.php index 4d747c6..f3bac2c 100644 --- a/Controller/ApiAddressAttributeController.php +++ b/Controller/ApiAddressAttributeController.php @@ -61,7 +61,7 @@ final class ApiAddressAttributeController extends Controller return; } - $type = AddressAttributeTypeMapper::get()->where('id', (int) $request->getData('type'))->execute(); + $type = AddressAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute(); $attribute = $this->createAttributeFromRequest($request, $type); $this->createModel($request->header->account, $attribute, AddressAttributeMapper::class, 'attribute', $request->getOrigin()); $this->createStandardCreateResponse($request, $response, $attribute); @@ -359,7 +359,7 @@ final class ApiAddressAttributeController extends Controller } /** @var AttributeType $old */ - $old = AddressAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $old = AddressAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute(); $new = $this->updateAttributeTypeFromRequest($request, clone $old); $this->updateModel($request->header->account, $old, $new, AddressAttributeTypeMapper::class, 'address_attribute_type', $request->getOrigin()); @@ -391,7 +391,7 @@ final class ApiAddressAttributeController extends Controller } /** @var AttributeType $addressAttributeType */ - $addressAttributeType = AddressAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $addressAttributeType = AddressAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute(); $this->deleteModel($request->header->account, $addressAttributeType, AddressAttributeTypeMapper::class, 'address_attribute_type', $request->getOrigin()); $this->createStandardDeleteResponse($request, $response, $addressAttributeType); } diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php index de2009a..1e0e27b 100644 --- a/Controller/ApiAttributeController.php +++ b/Controller/ApiAttributeController.php @@ -61,7 +61,7 @@ final class ApiAttributeController extends Controller return; } - $type = UnitAttributeTypeMapper::get()->where('id', (int) $request->getData('type'))->execute(); + $type = UnitAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute(); $attribute = $this->createAttributeFromRequest($request, $type); $this->createModel($request->header->account, $attribute, UnitAttributeMapper::class, 'attribute', $request->getOrigin()); $this->createStandardCreateResponse($request, $response, $attribute); @@ -359,7 +359,7 @@ final class ApiAttributeController extends Controller } /** @var AttributeType $old */ - $old = UnitAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $old = UnitAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute(); $new = $this->updateAttributeTypeFromRequest($request, clone $old); $this->updateModel($request->header->account, $old, $new, UnitAttributeTypeMapper::class, 'unit_attribute_type', $request->getOrigin()); @@ -391,7 +391,7 @@ final class ApiAttributeController extends Controller } /** @var AttributeType $unitAttributeType */ - $unitAttributeType = UnitAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); + $unitAttributeType = UnitAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute(); $this->deleteModel($request->header->account, $unitAttributeType, UnitAttributeTypeMapper::class, 'unit_attribute_type', $request->getOrigin()); $this->createStandardDeleteResponse($request, $response, $unitAttributeType); }