Add application API and OpenAPI docs
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\ProjectBoard;
|
||||
|
||||
use App\Models\BoardColumn;
|
||||
use App\Models\Project;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class UpdateBoardColumn
|
||||
{
|
||||
use ReordersBoardColumns;
|
||||
|
||||
/**
|
||||
* @param array{name: string, position: int} $validated
|
||||
*/
|
||||
public function handle(Project $project, BoardColumn $boardColumn, array $validated): BoardColumn
|
||||
{
|
||||
DB::transaction(function () use ($boardColumn, $project, $validated): void {
|
||||
$boardColumn->update([
|
||||
'name' => Arr::get($validated, 'name'),
|
||||
]);
|
||||
|
||||
$this->reorderColumns($project, $boardColumn, Arr::get($validated, 'position'));
|
||||
});
|
||||
|
||||
return $boardColumn->fresh();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user