Created
April 11, 2025 23:28
-
-
Save ofelix03/42fc5df63a706560ca2c2f7e52268932 to your computer and use it in GitHub Desktop.
FormSaveReasonDialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {patch} from "@web/core/utils/patch"; | |
import {FormController} from "@web/views/form/form_controller"; | |
import {useService} from "@web/core/utils/hooks"; | |
// import our custom dialog component | |
import {FormSaveReasonDialog} from "../../../custom_dialog/customer_dialog"; | |
patch(FormController.prototype, { | |
setup() { | |
super.setup(); | |
this.dialogService = useService("dialog"); | |
}, | |
async save(params) | |
const res = super.save(params); | |
// pass custom dialog component, plus props to the dialog service | |
this.dialogService.add(FormSaveReasonDialog, { | |
getPayload: (payload) => { | |
const {reason} = payload; | |
}, | |
});; | |
return res | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment