我刚刚开始使用 sails-filemaker 与 filemaker 服务器通信。我喜欢 :-) 我正在寻找一种方法来处理 HTML PUT 请求以更新记录。
模型是
/**
* LocalityFilemaker.js
*
* @description :: Suburbs (locality) in the evolution database.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
connection: 'filemaker',
tableName: 'locality-sails-layout',
attributes: {
id: {
type: 'integer',
primaryKey: true,
autoIncrement: true
},
suburb: {
type: 'string'
},
state: {
type: 'string'
},
postcode: {
type: 'string'
}
}
};
当我调用 get 到 {{url}}/localityFilemaker/12600 时,我得到了响应。
{
"id": 12600,
"suburb": "LARGS BAY",
"state": "SA",
"postcode": "5016",
"modid": "3",
"recid": "29500",
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z"
}
当我调用 put 到 {{url}}/localityFilemaker/12600 或 {{url}}/localityFilemaker
{
"id": 12600,
"suburb": "LARGS BAY.",
"state": "SA",
"postcode": "5016",
"recid": "29500"
}
我收到 400 错误请求。使用 sails-filemaker 使用 PUT HTML 请求更新记录的最佳方法是什么?
最佳答案
如果我错了,希望托德能纠正我。看起来“recid”是 FileMaker 内部记录 ID,您的 put 正在尝试更新它。从您的 put JSON 中删除“recid”,它应该可以工作。
关于sails.js - HTML PUT sails-filemaker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31450632/