| @@ 281-290 (lines=10) @@ | ||
| 278 | * |
|
| 279 | * @return \Symfony\Component\HttpFoundation\Response |
|
| 280 | */ |
|
| 281 | public function postAssign(Project $project, Request $request) |
|
| 282 | { |
|
| 283 | $status = false; |
|
| 284 | if ($request->has('user_id')) { |
|
| 285 | $project->assignUser((int) $request->input('user_id')); |
|
| 286 | $status = true; |
|
| 287 | } |
|
| 288 | ||
| 289 | return response()->json(['status' => $status]); |
|
| 290 | } |
|
| 291 | ||
| 292 | /** |
|
| 293 | * Ajax: remove user from the project. |
|
| @@ 300-309 (lines=10) @@ | ||
| 297 | * |
|
| 298 | * @return \Symfony\Component\HttpFoundation\Response |
|
| 299 | */ |
|
| 300 | public function postUnassign(Project $project, Request $request) |
|
| 301 | { |
|
| 302 | $status = false; |
|
| 303 | if ($request->has('user_id')) { |
|
| 304 | $project->unassignUser((int) $request->input('user_id')); |
|
| 305 | $status = true; |
|
| 306 | } |
|
| 307 | ||
| 308 | return response()->json(['status' => $status]); |
|
| 309 | } |
|
| 310 | ||
| 311 | /** |
|
| 312 | * To add a new note to the project. |
|