Prats
Prats

Reputation: 1765

Is there any way to add url parameters to the backbone destroy method

Right now I am passing data via headers in the destroy request like shown below

            this.model.destroy(
            {
               headers: {
                  'myId': myId
               }
            }
        );

Is it possible to pass myId as the url parameter to delete request ?

Thanks, Prats

Upvotes: 1

Views: 1548

Answers (1)

neeebzz
neeebzz

Reputation: 11538

You can pass the data in object in the destroy params

this.model.destroy(
            {
               data: {
                  'myId': myId
               }
            }

Upvotes: 1

Related Questions