# How to refresh after delete dashboard from external api

**URL:** <https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579>\
**Category:** Kibana\
**Created:** [April 5, 2019, 11:41am UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579 "2019-04-05T11:41:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivendra\_Prakash\_Sh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shivendra_prakash_sh/32/38161_2.png) [@Shivendra\_Prakash\_Sh](https://discuss.elastic.co/u/Shivendra_Prakash_Sh)\
**Post date:** [April 5, 2019, 11:41am UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579/1 "2019-04-05T11:41:27Z")

</div>

In the dashboard section, For deleting the dashboard through the external API, but I can't refresh the dashboard. but I try with inbuilt delete API that time refresh is working fine. If I want to use the same code for external API's refresh that time If you hit the same dashboard twice then second-time refresh the Dashboard happen. Please suggest to me how I will do first hit only.

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 5, 2019, 3:07pm UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579/2 "2019-04-05T15:07:21Z")

</div>

You can use the Visualize app to create visualizations that can provide insight to your logs. See [Creating a visualization](https://www.elastic.co/guide/en/kibana/6.7/createvis.html) for instructions

---

<div class="post-metadata">

**Author:** ![Shivendra\_Prakash\_Sh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shivendra_prakash_sh/32/38161_2.png) [@Shivendra\_Prakash\_Sh](https://discuss.elastic.co/u/Shivendra_Prakash_Sh)\
**Post date:** [April 5, 2019, 5:37pm UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579/3 "2019-04-05T17:37:46Z")

</div>

No I am asking when i want to delete the custom dashboard instead of inbuilt delete method, I called the External API when I will get the response that time I want refreshes the dashboard..

in built method :

dashboardService.delete(selectedIds)  
.then(fetchItems)  
.then(() =\> {  
deselectAll();  
})  
.catch(error =\> notify.error(error));

External API :

$http({  
method : "POST",  
url : '/v1/schedule/delete',  
data: {type:selectedIds}  
}).success(function(resp).then(fetchItems)  
.then(() =\> {  
fetchItems(); //refresh the dashboard  
deselectAll();  
notify.info(resp);  
}).catch(error =\> notify.error(error));  
}).error(function(resp){  
notify.error("The offline aggregator service is down. ")  
});

Here when I am twice hit the external API then after Refresh the dashboard. Please suggest why it's happening?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 5, 2019, 7:06pm UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579/4 "2019-04-05T19:06:46Z")

</div>

Sorry for the first reply, posted an answer to a different question into this thread, too many browser tabs open.

Are you executing your success handler in the context of Angular digest cycle? Try wrapping your fetchItems inside of the below logic. Angular will only update the DOM when a digest cycle is run

```auto
$scope.$evalAsync(() => {
}

```

---

<div class="post-metadata">

**Author:** ![Shivendra\_Prakash\_Sh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shivendra_prakash_sh/32/38161_2.png) [@Shivendra\_Prakash\_Sh](https://discuss.elastic.co/u/Shivendra_Prakash_Sh)\
**Post date:** [April 8, 2019, 4:47am UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579/5 "2019-04-08T04:47:57Z")

</div>

> [@Shivendra\_Prakash\_Sh](#):
>
> o I am asking when i want to delete the custom dashboard instead of inbuilt delete method, I called the External API when I will get the re

Hi Nathan,

I totally removed the inbuilt delete api , i used the external delete api what code already shared . here issue, it's not refresh first time, when twice i hited the delete api then refresh is happening. Please suggest to me what i missed here.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 6, 2019, 4:48am UTC](https://discuss.elastic.co/t/how-to-refresh-after-delete-dashboard-from-external-api/175579/6 "2019-05-06T04:48:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
