| @@ 88-103 (lines=16) @@ | ||
| 85 | * |
|
| 86 | * @return \Illuminate\Http\JsonResponse |
|
| 87 | */ |
|
| 88 | public function putIssue(Request $request, Issue $issue) |
|
| 89 | { |
|
| 90 | try { |
|
| 91 | $issue = $this->dispatch(new UpdateIssueCommand( |
|
| 92 | $issue, |
|
| 93 | $request->get('title'), |
|
| 94 | $request->get('description'), |
|
| 95 | $request->get('author_id'), |
|
| 96 | $request->get('project_id') |
|
| 97 | )); |
|
| 98 | } catch (QueryException $e) { |
|
| 99 | throw new BadRequestHttpException(); |
|
| 100 | } |
|
| 101 | ||
| 102 | return $this->item($issue); |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * Delete an existing issue. |
|
| @@ 58-73 (lines=16) @@ | ||
| 55 | * |
|
| 56 | * @return \Illuminate\Http\JsonResponse |
|
| 57 | */ |
|
| 58 | public function postOwners(Request $request) |
|
| 59 | { |
|
| 60 | try { |
|
| 61 | $owner = $this->dispatch(new AddOwnerCommand( |
|
| 62 | $request->get('name'), |
|
| 63 | $request->get('path'), |
|
| 64 | $request->get('user_id'), |
|
| 65 | $request->get('description'), |
|
| 66 | $request->get('type') |
|
| 67 | )); |
|
| 68 | } catch (QueryException $e) { |
|
| 69 | throw new BadRequestHttpException(); |
|
| 70 | } |
|
| 71 | ||
| 72 | return $this->item($owner); |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * Update an existing owner. |
|
| @@ 82-98 (lines=17) @@ | ||
| 79 | * |
|
| 80 | * @return \Illuminate\Http\JsonResponse |
|
| 81 | */ |
|
| 82 | public function putOwner(Request $request, Owner $owner) |
|
| 83 | { |
|
| 84 | try { |
|
| 85 | $owner = $this->dispatch(new UpdateOwnerCommand( |
|
| 86 | $owner, |
|
| 87 | $request->get('name'), |
|
| 88 | $request->get('path'), |
|
| 89 | $request->get('user_id'), |
|
| 90 | $request->get('description'), |
|
| 91 | $request->get('type') |
|
| 92 | )); |
|
| 93 | } catch (QueryException $e) { |
|
| 94 | throw new BadRequestHttpException(); |
|
| 95 | } |
|
| 96 | ||
| 97 | return $this->item($owner); |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Delete an existing owner. |
|