Skip to content

Commit

Permalink
Bugfix(PricingRules): Prevent Error when adding a new Pricing Rule wi…
Browse files Browse the repository at this point in the history
…th a name that exists (#216)

* Bugfix Pricing Rules -> #214

* Revert "Bugfix Pricing Rules -> #214"

This reverts commit 8806162.

* fix copy paste error

* Update src/PricingManager/Rule/Dao.php

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>

---------

Co-authored-by: Jacob Dreesen <jacob@hdreesen.de>
  • Loading branch information
ctippler and jdreesen authored Nov 29, 2024
1 parent 5caac82 commit 0ab52b1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/PricingManager/Rule/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ public function create(): void
*/
public function save(): void
{
if (!$this->model->getId()) {
$this->create();
}
$this->db->transactional(function () {
if (!$this->model->getId()) {
$this->create();
}

$this->update();
});

$this->update();
}

public function update(): void
Expand Down

0 comments on commit 0ab52b1

Please sign in to comment.