这是我想用 address.js 模型中的属性填充的客户模型,但是,当我们使用 Postman 发布 JSON 时,我得到 500 Validation Error 并没有太多关于问题原因的提示。任何帮助将不胜感激,因为我是sails、js、Javascript和编程的新手,所以我的语法可能是错误的!
//Customer.js
var Customer = {
attributes: {
honorific: 'STRING',
first_name: 'STRING',
middle_name: 'STRING',
last_name: 'STRING',
addr:'Address.address',
delivery_addr:'Address.address',
fullName:function() {
return this.first_name + ' ' + this.last_name;
}
}
};
module.exports = Customer;