Open a TaskStream board for a project that has none yet
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user