userfrosting / learn

Documentation and guide for UserFrosting
https://learn.userfrosting.com
MIT License
14 stars 41 forks source link

ufForm parameter name correction. #107

Closed cmy82 closed 2 years ago

cmy82 commented 2 years ago

The ajax paremater name in the plugin is ajax and not reqParams.

lcharette commented 2 years ago

I'm not sure about this one. It is reqParams in the code : https://github.com/userfrosting/UserFrosting/blob/621373002867c76bc581114b352b32ce2c19fb07/app/sprinkles/core/assets/userfrosting/js/uf-form.js#L180-L192

cmy82 commented 2 years ago

It is, but using reqParams doesn't pick up the changes. I couldn't find where it actually pulled any of the values from reqParams to update the options in the code, unless I missed that part. Using reqParams didn't work for me, but using ajax did.

cmy82 commented 2 years ago

If you look at the code above there: https://github.com/userfrosting/UserFrosting/blob/621373002867c76bc581114b352b32ce2c19fb07/app/sprinkles/core/assets/userfrosting/js/uf-form.js#L173-L174

It pulls the ajax settings parameter from the options passed in, but nowhere does it override the ajax settings with any values from reqParams value in the passed in settings.

https://github.com/userfrosting/UserFrosting/blob/621373002867c76bc581114b352b32ce2c19fb07/app/sprinkles/core/assets/userfrosting/js/uf-form.js#L281-L288

cmy82 commented 2 years ago

I guess either the parameter needs to be ajax, or line 174 need to be this.setteings.reqParams

lcharette commented 2 years ago

Oh I see. No you're right, it should be .ajax.

For my reference: https://learn.userfrosting.com/client-side-code/components/forms#reqparams