Do not reset background on every save
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
338f09b04b
commit
4118cb0be6
|
@ -127,19 +127,16 @@ class DashboardController extends Controller {
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
public function setBackground($path = null, $url = null, $shipped = null): JSONResponse {
|
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) {
|
if ($shipped !== null) {
|
||||||
$this->backgroundService->setShippedBackground($shipped);
|
$this->backgroundService->setShippedBackground($shipped);
|
||||||
}
|
} else if ($path !== null) {
|
||||||
if ($path !== null) {
|
|
||||||
$this->backgroundService->setFileBackground($path);
|
$this->backgroundService->setFileBackground($path);
|
||||||
}
|
} else if ($url !== null) {
|
||||||
if ($url !== null) {
|
|
||||||
$this->backgroundService->setUrlBackground($url);
|
$this->backgroundService->setUrlBackground($url);
|
||||||
}
|
} else {
|
||||||
$this->backgroundService->setDefaultBackground();
|
$this->backgroundService->setDefaultBackground();
|
||||||
|
}
|
||||||
|
|
||||||
return new JSONResponse([]);
|
return new JSONResponse([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue