Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alan Falloon 14 posts 144 karma points
    Mar 01, 2019 @ 01:20
    Alan Falloon
    0

    refreshing the tree after save and publish

    Hi Umbraco Community!

    I am trying to refresh the tree after pressing save and publish, inspired by https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/92658-force-refresh-backend-page-after-save-publish I am trying the following in a tweaks plugin I have added

    angular.module('umbraco.services').config([
    '$httpProvider',
    function ($httpProvider) {
        $httpProvider.interceptors.push(function ($q, navigationService) {
            return {
                'response': function (response) {
                    if (response.config.url.includes('/umbraco/backoffice/UmbracoApi/Content/PostSave')) {
                        if (response.status === 200) {
                            navigationService.syncTree({ tree: 'content', path: ["-1"], forceReload: true }); 
                        }
                    }
                    return response;
                }
            };
        });
      }
    ]);
    

    But I just see the following error in my console

    enter image description here

    Do you guys know if what I am trying to do is possible, have any ideas about how to achieve it?

    Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies