mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-14 16:58:42 +00:00
fix default respone generation
This commit is contained in:
parent
1af526fb9a
commit
de002fff45
|
|
@ -238,8 +238,7 @@ final class ApiController extends Controller
|
||||||
$interface = $this->createInterfaceFromRequest($request, $collection->id);
|
$interface = $this->createInterfaceFromRequest($request, $collection->id);
|
||||||
|
|
||||||
$this->createModel($request->header->account, $interface, InterfaceManagerMapper::class, 'interface', $request->getOrigin());
|
$this->createModel($request->header->account, $interface, InterfaceManagerMapper::class, 'interface', $request->getOrigin());
|
||||||
|
$this->createStandardCreateResponse($request, $response, $interface);
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Interface', 'Interface successfully created', $interface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -382,8 +381,8 @@ final class ApiController extends Controller
|
||||||
public function apiExchangeSettingCreate(RequestAbstract $request, HttpResponse $response, mixed $data = null) : void
|
public function apiExchangeSettingCreate(RequestAbstract $request, HttpResponse $response, mixed $data = null) : void
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateSettingCreate($request))) {
|
if (!empty($val = $this->validateSettingCreate($request))) {
|
||||||
$response->data['setting_create'] = new FormValidation($val);
|
$response->header->status = RequestStatusCode::R_400;
|
||||||
$response->header->status = RequestStatusCode::R_400;
|
$this->createInvalidCreateResponse($request, $response, $val);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -391,8 +390,7 @@ final class ApiController extends Controller
|
||||||
$setting = $this->createSettingFromRequest($request);
|
$setting = $this->createSettingFromRequest($request);
|
||||||
|
|
||||||
$this->createModel($request->header->account, $setting, ExchangeSettingMapper::class, 'setting', $request->getOrigin());
|
$this->createModel($request->header->account, $setting, ExchangeSettingMapper::class, 'setting', $request->getOrigin());
|
||||||
|
$this->createStandardCreateResponse($request, $response, $setting);
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Setting', 'Setting successfully created', $setting);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user