-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #719 from TheRestartProject/RES-1970_retry_discour…
…se_thread_creation RES-1970 Discourse private message creation is broken
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Events\ApproveEvent; | ||
use App\Group; | ||
use App\Helpers\Geocoder; | ||
use App\Listeners\CreateDiscourseThreadForEvent; | ||
use App\Party; | ||
use App\Services\DiscourseService; | ||
use Illuminate\Console\Command; | ||
use Riverline\MultiPartParser\Part; | ||
|
||
class DiscourseCreateThread extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'discourse:create:thread {partyid}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Retry creating a Discourse thread for a party'; | ||
|
||
/** | ||
* Create a new command instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(DiscourseService $discourseService) | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle(DiscourseService $discourseService) | ||
{ | ||
$id = $this->argument('partyid'); | ||
|
||
$party = Party::findOrFail($id); | ||
$event = new ApproveEvent($party); | ||
(new CreateDiscourseThreadForEvent())->handle($event); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters