Do not reset background on every save

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-08-14 16:47:17 +02:00
parent 338f09b04b
commit 4118cb0be6
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 5 additions and 8 deletions

View File

@ -127,19 +127,16 @@ class DashboardController extends Controller {
* @NoAdminRequired
*/
public function setBackground($path = null, $url = null, $shipped = null): JSONResponse {
// FIXME: store current version of the background and return the result
// FIXME: handle shipped backgrounds avoid file duplication
// FIXME: allow to reset to default ones
if ($shipped !== null) {
$this->backgroundService->setShippedBackground($shipped);
}
if ($path !== null) {
} else if ($path !== null) {
$this->backgroundService->setFileBackground($path);
}
if ($url !== null) {
} else if ($url !== null) {
$this->backgroundService->setUrlBackground($url);
} else {
$this->backgroundService->setDefaultBackground();
}
$this->backgroundService->setDefaultBackground();
return new JSONResponse([]);
}