| @@ 251-266 (lines=16) @@ | ||
| 248 | * |
|
| 249 | * @return void |
|
| 250 | */ |
|
| 251 | public function update() |
|
| 252 | { |
|
| 253 | if ($this->request->getHeader('content-type')[0] === 'application/json') |
|
| 254 | { |
|
| 255 | $data = JSON::decode((string)$this->request->getBody()); |
|
| 256 | } |
|
| 257 | else |
|
| 258 | { |
|
| 259 | $data = $this->request->getParsedBody(); |
|
| 260 | } |
|
| 261 | ||
| 262 | $response = $this->model->updateLibraryItem($data, $data); |
|
| 263 | ||
| 264 | $this->cache->clear(); |
|
| 265 | $this->outputJSON($response['body'], $response['statusCode']); |
|
| 266 | } |
|
| 267 | ||
| 268 | /** |
|
| 269 | * Remove an anime from the list |
|
| @@ 222-237 (lines=16) @@ | ||
| 219 | * |
|
| 220 | * @return void |
|
| 221 | */ |
|
| 222 | public function update() |
|
| 223 | { |
|
| 224 | if ($this->request->getHeader('content-type')[0] === 'application/json') |
|
| 225 | { |
|
| 226 | $data = JSON::decode((string)$this->request->getBody()); |
|
| 227 | } |
|
| 228 | else |
|
| 229 | { |
|
| 230 | $data = $this->request->getParsedBody(); |
|
| 231 | } |
|
| 232 | ||
| 233 | $response = $this->model->updateLibraryItem($data); |
|
| 234 | ||
| 235 | $this->cache->clear(); |
|
| 236 | $this->outputJSON($response['body'], $response['statusCode']); |
|
| 237 | } |
|
| 238 | ||
| 239 | /** |
|
| 240 | * Remove an manga from the list |
|