| @@ -20,13 +20,18 @@ | ||
| 20 | 20 | |
| 21 | 21 | public function updateConfig(Request $request, Response $response, Config $config) |
| 22 | 22 | { |
| 23 | 23 | |
| 24 | - if(!$config->updateConfig($request->input('config'))) { | |
| 24 | + $key = $request->input('key'); | |
| 25 | + $value = $request->input('value'); | |
| 25 | 26 | |
| 27 | + $config = $config->update($key, $value); | |
| 28 | + | |
| 29 | + if($config === false) { | |
| 30 | + | |
| 26 | 31 | return $response->json('Cannot save settings!', 422); |
| 27 | 32 | } |
| 28 | 33 | |
| 29 | - return $response->json('Done'); | |
| 34 | + return $response->json($config); | |
| 30 | 35 | } |
| 31 | 36 | |
| 32 | 37 | } |