Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting resourcemethod parameter for body #76

Closed
jaideepdas opened this issue Jan 18, 2017 · 3 comments
Closed

setting resourcemethod parameter for body #76

jaideepdas opened this issue Jan 18, 2017 · 3 comments

Comments

@jaideepdas
Copy link

jaideepdas commented Jan 18, 2017

This is the custom resource method I have added. I am passing the worksheet param which is a object expecting it to be passed as body of the request but its being passed against a key name 'worksheet' in the body.
How do I make the worksheet param as body of the request.

    @ResourceAction({
        method: RequestMethod.Put,
        isArray: false,
        path: '/{!:warriorId}/worksheet/{!:qstnSet}/{!:startDate}'
    })
    updateWorksheet: ResourceMethod<{ warriorId: number, startDate: number, qstnSet: string, worksheet: IWorksheet }, IWorksheet>;

Don't very clear from the documentation.

@troyanskiy
Copy link
Owner

Hello. For now it's not possible to do that.
I will think about the solution.

@troyanskiy
Copy link
Owner

I've made something special for you.
Please update the lib to ver 1.9.0
Now it's possible to create methods with split path params and body. In your case you can use it like that:

@ResourceAction({
  method: RequestMethod.Put,
  //isArray: false, by default it's false
  path: '/{!:warriorId}/worksheet/{!:qstnSet}/{!:startDate}'
})
updateWorksheet: ResourceMethodStrict<IWorksheet, { warriorId: number, startDate: number, qstnSet: string}, IWorksheet>;

@jaideepdas
Copy link
Author

@troyanskiy thanks for this exactly what I was looking for. Much cleaner and legible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants