I’m attempting to make a PUT request with Vue query builder in my project but I dont want the id to be in the URL.
Here is the request I have :
/api/v2/sites/927/asset_tracking_config/234
And I would like this :
/api/v2/sites/927/asset_tracking_config
The json file belong to the site, so I must not pass the id in the url, causing the request not work. If i removed the id in the object, the request becomes POST
Here is my model for this :
assetTrackingConfigs () {
return this.hasMany(AssetTrackingConfig)
}
My model for trackingConfig is this
resource () {
return 'asset_tracking_config}
And and building the request like this :
await new AssetTrackingConfig(params).for(site).save()
I think hasMany() is wrong here, but I can’t figure out how to make it work.
How can I directly GET / PUT/ POST without the object id getting automaticly in the url ?
Thanks by advance