Skip to content

Commit

Permalink
Trigger indexable even when restoring
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Mar 18, 2021
1 parent c831d92 commit 72a7399
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Core/RecycleBin/Services/RecycleBinService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace GetCandy\Api\Core\RecycleBin\Services;

use GetCandy\Api\Core\Products\Models\Product;
use GetCandy\Api\Core\RecycleBin\Interfaces\RecycleBinServiceInterface;
use GetCandy\Api\Core\RecycleBin\Models\RecycleBin;
use GetCandy\Api\Core\Search\Events\IndexableSavedEvent;
use GetCandy\Api\Core\RecycleBin\Interfaces\RecycleBinServiceInterface;

class RecycleBinService implements RecycleBinServiceInterface
{
Expand Down Expand Up @@ -40,6 +41,7 @@ public function restore($id)
$item = $this->findById($id);
if ($item->recyclable) {
$item->recyclable->restore();
IndexableSavedEvent::dispatch($item->recyclable);
$item->delete();
}
}
Expand Down

0 comments on commit 72a7399

Please sign in to comment.