Skip to content

Commit

Permalink
Allow custom parameters to be passed to a DELETE service
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed May 31, 2024
1 parent bd85035 commit a188a44
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/form/ControllerMixin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* A mixin for any edit window controller allowing for
* validation, saving, deletion, exports etc.
*
Expand Down Expand Up @@ -177,6 +177,15 @@ Ext.define('CpsiMapview.form.ControllerMixin', {
view.close();
},

/**
* Override this function to return any additional parameters to send to
* the Delete URL as a querystring
*

Check failure on line 183 in app/form/ControllerMixin.js

View workflow job for this annotation

GitHub Actions / build (14.x)

Trailing spaces not allowed
* @returns An object of key value pairs
*/
getDeleteParameters: function () {
return {};
},
/**
* Action for deletion
* */
Expand All @@ -189,6 +198,7 @@ Ext.define('CpsiMapview.form.ControllerMixin', {
rec.proxy.erase(Ext.create('Ext.data.operation.Destroy', {
url: rec.proxy.getUrl(),
records: [rec],
params: me.getDeleteParameters(),
callback: function (records, operation, success) {
w.unmask();
// do something whether the delete succeeded or failed
Expand Down

0 comments on commit a188a44

Please sign in to comment.