-
Notifications
You must be signed in to change notification settings - Fork 119
implement AV.Object save options #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
leeyeh
commented
Apr 5, 2016
- 支持 save 时传入 options.query
- 支持 save 时传入 options.fetchWhenSave
- 废弃 AV.Object#fetchWhenSave(仍可用)
Current coverage is
|
| try { | ||
| json._where = options.query.toJSON().where; | ||
| } catch (e) { | ||
| var error = new Error('options.query is not an AV.Query'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样处理错误不是很好呀,首先不应该认为只要有异常就是这个原因,然后原异常的调用栈被丢弃掉了,不方便调试。
|
👍 |
| if (dataObject._where) { | ||
| apiURL += ('?where=' + encodeURIComponent(JSON.stringify(dataObject._where))); | ||
| delete dataObject._where; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataObject._fetchWhenSave 与 dataObject._where 会不会有同时存在的情况?如果有,apiURL 可能拼接会有问题。
|
我 review 完了。 |
|
👍 |