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