Direct payments for invoices
Events can be moved to archive and moved back Fixed validation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Event\Controllers;
|
||||
|
||||
use App\Domains\Event\Actions\UnarchiveEvent\UnarchiveEventCommand;
|
||||
use App\Domains\Event\Actions\UnarchiveEvent\UnarchiveEventRequest;
|
||||
use App\Scopes\CommonController;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EventUnarchiveController extends CommonController
|
||||
{
|
||||
public function __invoke(int $eventId, Request $request): JsonResponse {
|
||||
$event = $this->events->getById($eventId);
|
||||
|
||||
$unarchiveRequest = new UnarchiveEventRequest($event);
|
||||
$unarchiveCommand = new UnarchiveEventCommand($unarchiveRequest);
|
||||
$response = $unarchiveCommand->execute();
|
||||
|
||||
return response()->json(['status' => $response->success ? 'success' : 'error']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user