chg: [analystData:API] Automatically encapsulate request's data into the analystType

pull/9677/head
Sami Mokaddem 2024-04-11 10:01:52 +02:00
parent 309242f358
commit 77a114673a
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 0 deletions

View File

@ -320,6 +320,11 @@ class AnalystDataController extends AppController
$this->AnalystData = $this->{$vt};
$this->modelClass = $vt;
$this->{$vt}->current_user = $this->Auth->user();
if (!empty($this->request->data)) {
if (!isset($this->request->data[$type])) {
$this->request->data = [$type => $this->request->data];
}
}
return $vt;
}
}