Skip to content

Commit

Permalink
Fire section update on background gallery changes
Browse files Browse the repository at this point in the history
  • Loading branch information
uldisrudzitis committed Feb 20, 2020
1 parent 1966e60 commit 76c62ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _api_app/app/Sites/Sections/SiteSectionsDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ public function backgroundGalleryDelete($name, $file)

$file = current(array_splice($files, $file_order, 1));
$this->array2xmlFile($sections, $this->XML_FILE, $this->ROOT_ELEMENT);
event(new SectionUpdated($this->SITE, $name));

return [
'site' => $this->SITE,
Expand Down Expand Up @@ -591,6 +592,7 @@ public function backgroundGalleryOrder($name, $new_files)
$section['mediaCacheData']['file'] = $new_files ? $reordered : [];

$this->array2xmlFile($sections, $this->XML_FILE, $this->ROOT_ELEMENT);
event(new SectionUpdated($this->SITE, $name));

return [
'site' => $this->SITE,
Expand Down Expand Up @@ -647,6 +649,7 @@ public function backgroundGalleryUpload($path, $file)

$sections[$section_idx] = $section;
$this->array2xmlFile(['section' => $sections], $this->XML_FILE, $this->ROOT_ELEMENT);
event(new SectionUpdated($this->SITE, $section['name']));

return [
'status' => 1,
Expand Down

0 comments on commit 76c62ae

Please sign in to comment.