0

In documentation, AdminBro said that they have predefined action

edit (record action) - update records in a resource

They also have hook after. So I define a function and assign it to MyResource.edit.after. The problem is this function not only execute when I save changes after edit, but also when I go to Edit page, that's not what I want.

How can I run this function only when I click Save Button on Edit page ?

skyboyer
  • 22,209
  • 7
  • 57
  • 64
Felix
  • 127
  • 2
  • 10

1 Answers1

1

I figured it out. Use before instead of after and compare request.method to POST in parameters

Felix
  • 127
  • 2
  • 10
  • This is working but i think this make requirement to operate wrongly , i want to only call my custom function after the record successfully Edit . – KAMAL Jan 02 '22 at 14:09