Can't Make Relationship Work
richherbs opened this issue · comments
Richard Herbert commented
User Model:
Role Model:
intermediate table UserRole:
Role Serializer:
import jsonApi from "jsonapi-serializer";
export const roleSerializer = new jsonApi.Serializer("roles", {
keyForAttribute: "camelCase",
attributes: ["id", "roleName", "users"],
users: {
attributes: [
"id",
"name",
"email",
"approved",
"language",
"createdAt",
"updatedAt",
"deletedAt"
]
}
});
export const countryDeserializer = new jsonApi.Deserializer({
keyForAttribute: "camelCase",
});
The instance of role serializes correctly but the relationship Users does not serialize.