feat: add company reassignment to project edit strip
Each project's Edit strip now has a Company dropdown. Changing company and saving moves the project card to the correct company section live without a page reload. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
a425e12349
commit
9a268dc79b
2 files changed
+47
-10
No files matched your search
@@ -70,16 +70,19 @@ class ProjectSettingController extends Controller
|
||||
public function update(Request $request, ProjectSetting $project)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'name' => 'required|string|max:255|unique:settings_projects,name,' . $project->id,
|
||||
'name' => 'required|string|max:255|unique:settings_projects,name,' . $project->id,
|
||||
'company_id' => 'nullable|exists:settings_companies,id',
|
||||
]);
|
||||
$project->update([
|
||||
'name' => $validated['name'],
|
||||
'is_active' => $request->boolean('is_active', true),
|
||||
'name' => $validated['name'],
|
||||
'company_id' => $validated['company_id'] ?? $project->company_id,
|
||||
'is_active' => $request->boolean('is_active', true),
|
||||
]);
|
||||
return response()->json(['project' => [
|
||||
'id' => $project->id,
|
||||
'name' => $project->name,
|
||||
'is_active' => $project->is_active,
|
||||
'id' => $project->id,
|
||||
'name' => $project->name,
|
||||
'is_active' => $project->is_active,
|
||||
'company_id' => $project->company_id,
|
||||
]]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user