File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ class FrontendAPI implements FrontendAPIInterface {
36
36
refreshMenuBadges : ( ) => void ;
37
37
}
38
38
39
+ public show : {
40
+ refresh ( ) : void ;
41
+ }
42
+
39
43
closeUserMenuDropdown ( ) : void {
40
44
console . log ( 'closeUserMenuDropdown' )
41
45
}
@@ -73,6 +77,12 @@ class FrontendAPI implements FrontendAPIInterface {
73
77
updateFilter : this . updateListFilter . bind ( this ) ,
74
78
clearFilters : this . clearListFilters . bind ( this ) ,
75
79
}
80
+
81
+ this . show = {
82
+ refresh : ( ) => {
83
+ console . log ( 'show.refresh' )
84
+ }
85
+ }
76
86
}
77
87
78
88
confirm ( params : ConfirmParams ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -281,4 +281,21 @@ async function startCustomAction(actionId) {
281
281
}
282
282
}
283
283
284
+ adminforth .show .refresh = () => {
285
+ (async () => {
286
+ try {
287
+ loading .value = true ;
288
+ await coreStore .fetchRecord ({
289
+ resourceId: String (route .params .resourceId ),
290
+ primaryKey: String (route .params .primaryKey ),
291
+ source: ' show' ,
292
+ });
293
+ } catch (e ) {
294
+ showErrorTost ((e as Error ).message );
295
+ } finally {
296
+ loading .value = false ;
297
+ }
298
+ })();
299
+ }
300
+
284
301
</script >
Original file line number Diff line number Diff line change @@ -121,6 +121,14 @@ export interface FrontendAPIInterface {
121
121
clearFilters ( ) : void ;
122
122
}
123
123
124
+ show : {
125
+ /**
126
+ * Full refresh the current record on the show page. Loader may be shown during fetching.
127
+ * Fire-and-forget; you don't need to await it.
128
+ */
129
+ refresh ( ) : void ;
130
+ }
131
+
124
132
menu : {
125
133
/**
126
134
* Refreshes the badges in the menu, by recalling the badge function for each menu item
You can’t perform that action at this time.
0 commit comments