Refresh a page after a callback action

Hi, i need to know please how can i Refresh the current page i try a lot of times but the same problem is appearing
inside my route i did something like that


  {
    path: '/orders/accepte/upload/before-picture/:orderid',
    
    async: function ({ router, to }) {

      // App instance
      var app = router.app;

      // Show Preloader
      // app.preloader.show();

      // Order CODE  from request
      var orderid = to.params.orderid;
      var UserID = getCookie('userID', true);

      app.dialog.preloader('Waiting Open Camera .. ');

      // Simulate Ajax Request
      setTimeout(function () {

      // Hide Preloader
        // app.preloader.hide();
        app.dialog.close();
      // Relaod Active orders page
      // app.views.main.router.navigate('/active-orders/');

    }, 1000);

    navigator.vibrate([2000, 1000, 500,500,500,500]);

      navigator.camera.getPicture(onSuccess, onFail, { 
          quality: 100,
          destinationType: Camera.DestinationType.FILE_URI

      });
      
      function onSuccess(imageURI) {
          var image = document.getElementById('myImage');
          image.src = imageURI;
      }
      
      function onFail(message) {
          // alert('Failed because: ' + message);

          app.request({
            url : API_URL + '/records/collection_orders/' + orderid,
            headers: {"X-API-Key": "123456"},
            data : { is_accepted:'0', collector_id:'0'  },
            contentType: 'application/x-www-form-urlencoded',
            method: 'PUT'
          });

          // How Refresh Page on framework 7
          app.views.main.router.refreshPage();

      }


    app.notification.create({
      icon: "<i class='icon f7-icons'>bell_circle_fill</i>",
      title: 'Order Accepted',
      titleRightText: 'Just now',
      subtitle: 'Please Attention !',
      text: 'You have accepted the order #' + orderid,
      closeTimeout: 10000
     }).open();


    },

  },

But i did every thing to refresh the page after Onfail call back any help please ?
In Other Word let’s say that i need to reload all my pages content how can i do that ?

In the router you can use only resolve() or reject() you can’t refresh page because you are not into a page. The process you try must be done into page instead of router.

1 Like