undo async

This commit is contained in:
joshhunt 2023-02-08 18:35:56 +00:00
parent abe2777a1f
commit d0f046ccd3
No known key found for this signature in database
GPG Key ID: F767869890CBA3F6

View File

@ -92,7 +92,7 @@ export class DashboardSrv {
);
}
async starDashboard(dashboardUid: string, isStarred: boolean) {
starDashboard(dashboardUid: string, isStarred: boolean) {
const backendSrv = getBackendSrv();
const request = {
@ -101,8 +101,7 @@ export class DashboardSrv {
method: isStarred ? 'DELETE' : 'POST',
};
await backendSrv.request(request);
return backendSrv.request(request).then(() => {
const newIsStarred = !isStarred;
if (this.dashboard?.uid === dashboardUid) {
@ -116,6 +115,7 @@ export class DashboardSrv {
appEvents.emit(AppEvents.alertSuccess, [message]);
return newIsStarred;
});
}
}