troyanskiy / ngx-resource

Resource (REST) Client for Angular 2
http://troyanskiy.github.io/ngx-resource/
200 stars 46 forks source link

PUT/POST Array to url with params #137

Closed CyrilleGuimezanes closed 7 years ago

CyrilleGuimezanes commented 7 years ago

Hello,

I have this url:

/api/v1/persons/{idPerson}/phones/{idPhone}

I would like to POST/PUT a list of phone to a person (like it's allowed in REST @see https://en.wikipedia.org/wiki/Representational_state_transfer) .

So in my TS I have:

[
 "01466666666",
 "05555555555",
 "06666666666",
 "07777777777"
]

But I need to define "idPerson" to complete resource URL /api/v1/persons/{idPerson}/phones/

I can construct an object like:

{
idPerson: 666,
data: [
 "01466666666",
 "05555555555",
 "06666666666",
 "07777777777"
]
}

But it's not REST anymore...

I looking for a way to create the method: myResouce.update(urlParms: any, bodyData: any)

Can you help me?

troyanskiy commented 7 years ago

Hello. Please search for ‘ResourceMethodStrict’ in the readme.

CyrilleGuimezanes commented 7 years ago

Oh ok, did not get it when a read it. Sorry.

Thank you!