| @@ 122-143 (lines=22) @@ | ||
| 119 | * |
|
| 120 | * @return DataResponse |
|
| 121 | */ |
|
| 122 | public function details($uniqueId) { |
|
| 123 | try { |
|
| 124 | $circle = $this->circlesService->detailsCircle($uniqueId); |
|
| 125 | ||
| 126 | return $this->success(['circle_id' => $uniqueId, 'details' => $circle]); |
|
| 127 | } catch (\Exception $e) { |
|
| 128 | ||
| 129 | return $this->fail(['circle_id' => $uniqueId, 'error' => $e->getMessage()]); |
|
| 130 | } |
|
| 131 | ||
| 132 | } |
|
| 133 | ||
| 134 | ||
| 135 | /** |
|
| 136 | * @NoAdminRequired |
|
| 137 | * @NoSubAdminRequired |
|
| 138 | * |
|
| 139 | * @param string $uniqueId |
|
| 140 | * @param array $settings |
|
| 141 | * |
|
| 142 | * @return DataResponse |
|
| 143 | */ |
|
| 144 | public function settings($uniqueId, $settings) { |
|
| 145 | try { |
|
| 146 | $this->verifyCreationName($settings['circle_name']); |
|
| @@ 144-155 (lines=12) @@ | ||
| 141 | * |
|
| 142 | * @return DataResponse |
|
| 143 | */ |
|
| 144 | public function settings($uniqueId, $settings) { |
|
| 145 | try { |
|
| 146 | $this->verifyCreationName($settings['circle_name']); |
|
| 147 | $circle = $this->circlesService->settingsCircle($uniqueId, $settings); |
|
| 148 | ||
| 149 | return $this->success(['circle_id' => $uniqueId, 'details' => $circle]); |
|
| 150 | } catch (\Exception $e) { |
|
| 151 | ||
| 152 | return $this->fail(['circle_id' => $uniqueId, 'error' => $e->getMessage()]); |
|
| 153 | } |
|
| 154 | ||
| 155 | } |
|
| 156 | ||
| 157 | ||
| 158 | /** |
|
| @@ 166-185 (lines=20) @@ | ||
| 163 | * |
|
| 164 | * @return DataResponse |
|
| 165 | */ |
|
| 166 | public function join($uniqueId) { |
|
| 167 | try { |
|
| 168 | $data = $this->circlesService->joinCircle($uniqueId); |
|
| 169 | ||
| 170 | return $this->success(['circle_id' => $uniqueId, 'member' => $data]); |
|
| 171 | } catch (\Exception $e) { |
|
| 172 | ||
| 173 | return $this->fail(['circle_id' => $uniqueId, 'error' => $e->getMessage()]); |
|
| 174 | } |
|
| 175 | } |
|
| 176 | ||
| 177 | ||
| 178 | /** |
|
| 179 | * @NoAdminRequired |
|
| 180 | * @NoSubAdminRequired |
|
| 181 | * |
|
| 182 | * @param string $uniqueId |
|
| 183 | * |
|
| 184 | * @return DataResponse |
|
| 185 | */ |
|
| 186 | public function leave($uniqueId) { |
|
| 187 | try { |
|
| 188 | $data = $this->circlesService->leaveCircle($uniqueId); |
|
| @@ 186-205 (lines=20) @@ | ||
| 183 | * |
|
| 184 | * @return DataResponse |
|
| 185 | */ |
|
| 186 | public function leave($uniqueId) { |
|
| 187 | try { |
|
| 188 | $data = $this->circlesService->leaveCircle($uniqueId); |
|
| 189 | ||
| 190 | return $this->success(['circle_id' => $uniqueId, 'member' => $data]); |
|
| 191 | } catch (\Exception $e) { |
|
| 192 | ||
| 193 | return $this->fail(['circle_id' => $uniqueId, 'error' => $e->getMessage()]); |
|
| 194 | } |
|
| 195 | ||
| 196 | } |
|
| 197 | ||
| 198 | ||
| 199 | /** |
|
| 200 | * @NoAdminRequired |
|
| 201 | * @NoSubAdminRequired |
|
| 202 | * |
|
| 203 | * @param string $uniqueId |
|
| 204 | * |
|
| 205 | * @return DataResponse |
|
| 206 | */ |
|
| 207 | public function destroy($uniqueId) { |
|
| 208 | try { |
|