Merge branch 'WarehouseProject/fix' into 'master'

Refactor WarehouseProjectController methods to simplify parameters

See merge request fronk/thetool!1922
This commit is contained in:
Luca Haid
2025-12-02 14:58:00 +00:00

View File

@@ -38,7 +38,7 @@ class WarehouseProjectController extends TTCrud {
private array $tempInternalTeam = [];
protected function beforeCreate($postData): bool {
protected function beforeCreate(): bool {
$json = json_decode(file_get_contents('php://input'), true);
if ($json) {
$this->postData = array_merge($this->postData ?? [], $json);
@@ -57,7 +57,7 @@ class WarehouseProjectController extends TTCrud {
return true;
}
protected function afterCreate($id, $postData): void
protected function afterCreate($id): void
{
WarehouseProjectJournalModel::create([
'projectId' => $id,
@@ -81,8 +81,9 @@ class WarehouseProjectController extends TTCrud {
}
}
protected function afterUpdate($id, $postData): void
protected function afterUpdate($postData): void
{
$id = $postData['id'];
// Simple journaling of main record update
WarehouseProjectJournalModel::create([
'projectId' => $id,