Model id not being pass to PUT or DELETE call on .save()

I am using 'ember-data-url-templates' in my model adapter.

When I do model.save(), or model.destroyRecord(), I get an error 400 because somehow the model id is not being passed to the network call.

Here is my adapter for the put

updateRecordUrlTemplate: ${ENV.API_ENDPOINT}/issues/template/{issueTemplateId}

When I do model.save() I get

As you can see, the model id is missing the the network call.

I don’t understand what I do incorrectly here. That’s something that is used throughout the app without any problem on other models.

If anyone could help, thanks!

Sounds to me like it’s just not picking up the last url segment properly, what does your custom url segments definition look like on this adapter?

There is no custom url segment define in my adapter file. Usually I don’t need to defined any custom segment only for the model id. Is that incorrect?

I am using updateRecordUrlTemplate elsewhere in the application and I don’t need to define any url segment for it to work. The model id is passed to the network call.

EDIT: Your comment made me realize something. My mistake was to use /{templateIssueId} instead of simply using /{id}, and I guess ember-data-url-template was expecting this to be a defined url segment. Using only /{id} works. Sorry I am still learning and a lot of this is by looking at older codes so I don’t always understand what I am doing. Thanks you very much for your help!

Ah nice glad you got it sorted out! That was my guess… since you weren’t using id you either had a custom segment definition for templateIssueId that wasn’t working right or you could have just been using id instead. Anyway good luck and definitely feel free to ask in here or Discord anytime you run into issues!