-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Here's my model:
api.define({
resource: 'classes',
handlers: mongo, // instantiated elsewhere
attributes: {
id: type.string(),
class_number: type.string().required().uppercase(), // this is my unique ID
department: type.string().uppercase(),
short_desc: type.string().uppercase(),
long_desc: type.string(),
type: type.string().uppercase().allow('LEC', 'LAB', 'SEM'),
// type is:
// - LEC for Lecture,
// - LAB for Laboratory work,
// - SEM for Seminar
category: type.string().allow('undergrad', 'phd', 'credential'),
__v: type.number()
}
});
Type refers to "Type of class" not "Type of Resource", but I in the output, type is affecting the relation link.
data: [
{
type: "LEC",
attributes: {
class_number: "10",
department: "EDUC",
short_desc: "ED RESEARCH DESIGN",
long_desc: "Educational Research Design",
category: "undergrad",
__v: 0
},
links: {
self: "/LEC/undefined"
}
},
{
type: "SEM",
attributes: {
class_number: "5",
department: "PHY SCI",
short_desc: "INTRO SCI/MATH TCHG",
long_desc: "Introduction to Science and Mathematics Teaching",
category: "undergrad",
__v: 0
},
links: {
self: "/SEM/undefined"
}
}
]
Thank you for any help you may provide.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels