lundi 10 septembre 2018

BelongsTo not returning the value in Ember?

Response:

data:{type: "individuals", id: "xxx-xx-x--x--x",…}
attributes:{user_id: "xxx-xx-x--x--x", ces_user_id: "dsffdsf", first_name: "Test",…}
id:"xxx-xx-x--x--x"
relationships:{addresses: {data: [{type: "addresses", id: "0fe0e6ad-27a1-4e90-9d1f-034716f0ccc4"}]},…}
addresses:{data: [{type: "addresses", id: "0fe0e6ad-27a1-4e90-9d1f-034716f0ccc4"}]}
degrees:{data: [{type: "degrees", id: "2f00d21a-01dc-4391-8aca-a61491a2e7b8"},…]}
emails:{data: [{type: "emails", id: "e0166097-1e2f-4502-8fbc-7522a256c69a"},…]}
faxes:{data: []}
licenses:{data: [{type: "licenses", id: "294e19ac-a7f2-4316-9454-0b0b7276ebd9"},…]}
memberships:{data: []}
organizations:{data: [{type: "organizations", id: "c4178037-3ffc-4984-a317-9a489f2dca54"}]}
phones:{data: [{type: "phones", id: "c04d850b-0174-47f7-95ee-d01d7c51dbf0"}]}
user_image:{data: {id: 23811, type: "user_image"}}
data:{id: 23811, type: "user_image"}
id:23811
type:"user_image"
type:"individuals"
included:[
{type: "addresses", id: "0fe0e6ad-27a1-4e90-9d1f-034716f0ccc4",…},
{type: "emails", id: "e0166097-1e2f-4502-8fbc-7522a256c69a",…},
{type: "emails", id: "47de146a-00b5-4c4d-a492-5f865e14fd6a",…},
{type: "degrees", id: "2f00d21a-01dc-4391-8aca-a61491a2e7b8",…},
{type: "degrees", id: "2b131aec-79c7-4169-8fbc-68fc06aa7e6f",…},
{type: "phones", id: "c04d850b-0174-47f7-95ee-d01d7c51dbf0",…},
{type: "organizations", id: "c4178037-3ffc-4984-a317-9a489f2dca54",…},
{
attributes:{cloudinary-id: "dsfdfsfsddsfsdf", created: "2018-09-08T17:59:53+00:00", published: true,…}
id:23811
type:"user_image"
},
{type: "licenses", id: "294e19ac-a7f2-4316-9454-0b0b7276ebd9",…},
{type: "licenses", id: "21f0c34e-2a51-44b5-bd88-ad57bb28e066",…},
{type: "licenses", id: "43972613-a115-4f6c-937f-16ba823d70f3",…},
{type: "licenses", id: "75be099d-0926-4101-92db-e8e5eb283867",…},
{type: "institutions", id: "61EB6A22-3082-486A-B15E-96E976CD2289",…},
{type: "institutions", id: "339DF935-E3B1-41C5-A3E6-F53120C2856E",…},
]

In ember application, I am getting the above response, and not able to get the user-image. I created a separate model for user-image and relate it to the parent model 'individual' with a belongsTo relationship. Can someone help with that?




Aucun commentaire:

Enregistrer un commentaire