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 {
3636 refreshMenuBadges : ( ) => void ;
3737 }
3838
39+ public show : {
40+ refresh ( ) : void ;
41+ }
42+
3943 closeUserMenuDropdown ( ) : void {
4044 console . log ( 'closeUserMenuDropdown' )
4145 }
@@ -73,6 +77,12 @@ class FrontendAPI implements FrontendAPIInterface {
7377 updateFilter : this . updateListFilter . bind ( this ) ,
7478 clearFilters : this . clearListFilters . bind ( this ) ,
7579 }
80+
81+ this . show = {
82+ refresh : ( ) => {
83+ console . log ( 'show.refresh' )
84+ }
85+ }
7686 }
7787
7888 confirm ( params : ConfirmParams ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -281,4 +281,21 @@ async function startCustomAction(actionId) {
281281 }
282282}
283283
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+
284301 </script >
Original file line number Diff line number Diff line change @@ -121,6 +121,14 @@ export interface FrontendAPIInterface {
121121 clearFilters ( ) : void ;
122122 }
123123
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+
124132 menu : {
125133 /**
126134 * 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