Allow budget store to have optional webhook using "fire_webhooks".

This commit is contained in:
James Cole
2025-09-14 08:55:29 +02:00
parent 9e6f9d16e4
commit c2d3f5da16
6 changed files with 46 additions and 20 deletions

View File

@@ -44,6 +44,7 @@ use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
use FireflyIII\Support\Singleton\PreferencesSingleton;
use Illuminate\Database\QueryException;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
@@ -724,6 +725,10 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
{
$order = $this->getMaxOrder();
// this is a lame trick to communicate with the observer.
$singleton = PreferencesSingleton::getInstance();
$singleton->setPreference('fire_webhooks_budget_create', $data['fire_webhooks'] ?? true);
try {
$newBudget = Budget::create(
[