Refactor WarehouseProjectController methods to simplify parameters
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user