ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

[RFR] Ability to use custom method for get requests

Open lukemarsh opened this issue 10 years ago • 10 comments

I have just submitted a pull request for your admin-config module for adding a custom method to get requests. I have changed getOne and getList functions to allow for the custom methods

lukemarsh avatar Jul 13 '15 08:07 lukemarsh

Could you document the change in the docs? (cf 54f50e8e9b647966014dec3ec91bc6282cc57b65)

fzaninotto avatar Jul 13 '15 14:07 fzaninotto

Refs https://github.com/marmelab/admin-config/pull/24

fzaninotto avatar Jul 13 '15 14:07 fzaninotto

Good to me. Waiting for marmelab/admin-config#24 PR to be merged.

jpetitcolas avatar Jul 24 '15 07:07 jpetitcolas

Can you just rebase on master to ensure all tests are green? We fixed them yesterday. :)

jpetitcolas avatar Jul 24 '15 07:07 jpetitcolas

Your PR absolutely doesn't work. Did you even test it? The restangular code doesn't make sense.

Please, test your code before submitting it (e.g. by setting the retrieveMethod to 'GET' to make sure it doesn't break anything), I just spent half an hour trying to make this work.

fzaninotto avatar Jul 28 '15 20:07 fzaninotto

Apologies for wasting your time on this one! I have since fixed said issues but the tests were failing due to some dependency issues, which I have fixed with this PR: https://github.com/marmelab/ng-admin/pull/585

lukemarsh avatar Aug 03 '15 16:08 lukemarsh

Did you test with a simple posts.retrieveMethod('GET') in the example to check that it works?

fzaninotto avatar Aug 04 '15 22:08 fzaninotto

Yes I did and it works :) but the method needs to be lowercase!

lukemarsh avatar Aug 05 '15 09:08 lukemarsh

Is this now fully implemented and works now?

I would also really need that feature to force POST method on the getList()...

Thanks much much and best regards; C

CKUDG avatar Sep 07 '15 12:09 CKUDG

Did you test with a simple posts.retrieveMethod('GET') in the example to check that it works?

It seems that posts.retrieveMethod('get') changesgetList operation to 'get', so it does not work. This test is edge case, because many uses case is that both getList and get operation are wanted to be POST method, not GET method. If you want it, I will write pull-request to admin-config that devides retrieveMethod into getMethod and getListMethod, but It would be too much. or I can just fix conflict of this PR. Which do you prefer?

mosasiru avatar Jan 31 '17 16:01 mosasiru