I have two tables with one to one relationship as following
I need to call the api to create the record as following
api end-point : http://localhost:81/api/v2/treat_well/_table/tw_venue?related=tw_venue_contact
body:
{
"resource": [
{
"name": "Rest Point",
"type_id" : "1",
"description":"The comfort place to take rest with our care.",
"logo":"http://www.logo.png",
"tw_venue_contact_by_venue_id":[
{
"longtitude":"6.87491200",
"latitude" : "6.87491200",
"address" : "Colombo-06",
"city_id" : "1",
"country_id" : "1",
"phone" : "0112345678",
"mobile" : "0771234567",
"email" : "touch@relif.com",
"website" : "http://relief.com",
"twitter" : "http://google.com/releif",
"google" : "http://google.com/releif",
"added_date" : "2016-01-01",
"user_id" : "26"
}
]
}
]
}
Iām getting error as following
{
āerrorā: {
ācontextā: null,
āmessageā: āFailed to update many to one assignment.\nRelated record has no primary key value for āvenue_idā.ā,
ācodeā: 400,
Iām trying to create the records by with having** one to one relationship** why do i get this error from DSP?
But when i try to create the records between one to many relationship tables itās working fine.
Whatās the mistake that i have been here? Please anyone explain to me @formerstaff @benbusse ā¦