Refactored the bulk edit controller.

This commit is contained in:
James Cole
2019-07-04 17:31:47 +02:00
parent 54623061d8
commit 3c5c14ff5a
16 changed files with 432 additions and 170 deletions

View File

@@ -778,7 +778,16 @@ class JournalRepository implements JournalRepositoryInterface
/** @var JournalUpdateService $service */
$service = app(JournalUpdateService::class);
return $service->updateBudget($journal, $budgetId);
$service->setTransactionJournal($journal);
$service->setData(
[
'budget_id' => $budgetId,
]
);
$service->update();
$journal->refresh();
return $journal;
}
/**
@@ -793,8 +802,16 @@ class JournalRepository implements JournalRepositoryInterface
{
/** @var JournalUpdateService $service */
$service = app(JournalUpdateService::class);
$service->setTransactionJournal($journal);
$service->setData(
[
'category_name' => $category,
]
);
$service->update();
$journal->refresh();
return $service->updateCategory($journal, $category);
return $journal;
}
/**
@@ -809,10 +826,16 @@ class JournalRepository implements JournalRepositoryInterface
{
/** @var JournalUpdateService $service */
$service = app(JournalUpdateService::class);
$service->connectTags($journal, $tags);
$service->setTransactionJournal($journal);
$service->setData(
[
'tags' => $tags,
]
);
$service->update();
$journal->refresh();
return $journal;
}
/**