Update StatusDelete pipeline

This commit is contained in:
Daniel Supernault 2018-11-03 21:24:50 -06:00
parent 243c62e73f
commit 7492194cc2
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -2,9 +2,12 @@
namespace App\Jobs\StatusPipeline; namespace App\Jobs\StatusPipeline;
use App\Notification; use App\{
use App\Status; Notification,
use App\StatusHashtag; Report,
Status,
StatusHashtag,
};
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
@ -73,6 +76,9 @@ class StatusDelete implements ShouldQueue
->whereItemId($status->id) ->whereItemId($status->id)
->delete(); ->delete();
StatusHashtag::whereStatusId($status->id)->delete(); StatusHashtag::whereStatusId($status->id)->delete();
Report::whereObjectType('App\Status')
->whereObjectId($status->id)
->delete();
$status->delete(); $status->delete();
return true; return true;