I am currently using a custom function that wraps the app.request.post()
method, but I think there must be a better way to setup this function. Currently I’m defining the method like so:
// in my app.f7.html
export default {
mounted() {
var self = this;
var app = self.$app;
self.$f7ready(() => {
app.request.customPost = async (endpoint, payload, success, error) => {
payload['customField'] = 'somethingCustom'
app.request.post(endpoint, payload)
})
}
}
}
Is there a better way to create a custom wrapper for this function?