Open a TaskStream board for a project that has none yet
Some checks failed
Tests / lint (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / test-postgres (push) Has been cancelled
Tests / mcp (push) Has been cancelled

The project form gets «Crear en TaskStream» while the project has no
board, and `taskstream: true` on a PATCH does the same through the API.
A refusal leaves the edit unsaved; a project with a board keeps it, and
`taskstream_key` without the flag is still ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 20:21:38 +02:00
parent 7e7d2847fe
commit 3c119d425e
13 changed files with 207 additions and 28 deletions

View File

@@ -72,11 +72,22 @@ class ProjectController extends Controller
return ProjectResource::make($project->load(self::WITH));
}
public function update(ProjectRequest $request, Project $project): ProjectResource
/**
* `taskstream: true` opens a board for a project that has none yet, as on
* creation (and nothing is saved if that fails); one that has a board
* keeps it.
*/
public function update(ProjectRequest $request, Project $project, OpenInTaskStream $openInTaskStream): ProjectResource
{
$this->authorize('update', $project);
return ProjectResource::make($this->persist($this->fill($project, $request), $request));
$project = $this->fill($project, $request);
if ($request->boolean('taskstream') && $project->taskstream_project_id === null) {
$openInTaskStream->handle($project, $request->user(), $request->bearerToken(), $request->validated('taskstream_key'));
}
return ProjectResource::make($this->persist($project, $request));
}
public function destroy(Project $project): JsonResponse