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