File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ export class CommandManager {
143143 await this . reopenCurrentCommand ( ) ;
144144 return ;
145145 }
146+ this . state . currentCommandEndpoints . onSuccess ?.( ) ;
146147 this . finish ( ) ;
147148 return ;
148149 }
@@ -152,6 +153,9 @@ export class CommandManager {
152153 if ( data . action !== 'step' ) {
153154 // close form modal
154155 this . state . currentCommandForm = null ;
156+ if ( ! this . state . currentCommandShouldReopen ) {
157+ this . state . currentCommandEndpoints . onSuccess ?.( ) ;
158+ }
155159 }
156160
157161 await this . handleCommandResponse ( data ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ export type CommandEndpoints = {
2222 postCommand : string
2323 getForm : string
2424 query ?: object
25+ /**
26+ * Called after the form is submitted and a successful response is received with some exceptions:
27+ * - if reopen has been clicked, it is not called
28+ * - if the response is a wizard step, it is not called
29+ */
30+ onSuccess ?: ( ) => void
2531
2632 entityKey : string
2733 instanceId ?: string | number
Original file line number Diff line number Diff line change 223223 .map (([instanceId , selected ]) => instanceId ),
224224 },
225225 entityKey ,
226+ onSuccess() {
227+ selectedItems .value = null ;
228+ },
226229 });
227-
228- selectedItems .value = null ;
229230 }
230231
231232 async function onDelete(instanceId : InstanceId ) {
You can’t perform that action at this time.
0 commit comments