troyanskiy / ngx-resource-core

RESTful Core Library
40 stars 10 forks source link

Question on different Resource Methods #32

Closed cschaepe closed 5 years ago

cschaepe commented 6 years ago

Sorry for the simple question but I find the examples a little confusing as to what the various ResourceMethods do and when I should use them. A simple paragraph on the various methods and why I would choose one over the other would be great.

I tried the following Resource method

@ResourceAction({ isArray: false, path: 'orgs/{!orgId}/agents/{!id}', auth: true, toPromise: true, method: ResourceRequestMethod.Put }) private _agentResourcePut: IResourceMethod<IAgentQueryParams, AgentModel>;

called with this._agentResourcePut({ orgId: orgId, id: agent.id }, agent, (agent: AgentModel) => { this.handleSuccess('update', this.agent, null, success); }, (response: ApiResponse) => { this.handleFailure('update', response, failure); });

I am finding that it is putting all my AgentModel Parameters in the query string along with my query parameters. Should I be using the strict method? I am simply want to pass an object for the query parameters and an object for the Model and get a Model back in response.

Thanks

troyanskiy commented 5 years ago

Hello @all I did some refactoring and repository restructuring. From now on new repository is located here https://github.com/troyanskiy/ngx-resource Please create new issues in new repo. I will close all the issues in that repo.

Also I have released 7.0.0-beta.5 version with Observables support. Please test it and create new issues in new repo if you will find some bugs.

To update to new version run npm i --save @ngx-resource/core@beta @ngx-resource/handler-ngx-http@beta

Breaking changes:

ResourceGlobalConfig

IResourceParams and IResourceAction

Deprecation

New

I still have to update Docs and provide migration guide.

Thank you @all !!!