Overriding default primary key identifier fields to desired field in parameter passes api call?


#1

As i understood the DSP which utilizes the primary key field attribute to get/patch/delete(via api) the row of table in default. But in some cases we need to set our desired field to identify the record for above api calls.

I have the following table

Here, venue_id and service_id contains the composite primary key so i need to identify the row records according to venue_svc_id (which contains the unique index).

When i call the ptching api of tw_venue_service as bellow
PATCH : http://localhost:81/api/v2/treat_well/_table/tw_venue_services/2
It throws the following message

“message”: “Record with identifier ‘Array\n(\n [venue_id] => 2\n [service_id] => 2\n)\n’ not found.”

It maps the passed parameter id with composite fields. But here we want to map with venue_svc_id.

How to override this behavior to read the venue_svc_id field??
Please tell me the solutions in DSP?

Thanks


#2

Fond the solution by myself…}

We have the id_field=venue_svc_id to denote the identifier… it assisted to me…:slightly_smiling: