Skip to content

Commit 6e55e59

Browse files
committed
Fix typo,
- Adds automatic downloadName to match original Parse API
1 parent 9c47790 commit 6e55e59

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

spec/PurchaseValidation.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ describe("test validate_receipt endpoint", () => {
182182
product.set("title", "a new title");
183183
return product.save();
184184
}).then(function(productAgain){
185+
expect(productAgain.get('downloadName')).toEqual(productAgain.get('download').name());
185186
expect(productAgain.get("title")).toEqual("a new title");
186187
done();
187188
}).fail(function(err){

src/RestWrite.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,10 @@ RestWrite.prototype.runDatabaseOperation = function() {
683683
throw new Parse.Error(Parse.Error.SESSION_MISSING,
684684
'cannot modify user ' + this.query.objectId);
685685
}
686+
687+
if (this.className === '_Product' && this.data.download) {
688+
this.data.downloadName = this.data.download.name;
689+
}
686690

687691
// TODO: Add better detection for ACL, ensuring a user can't be locked from
688692
// their own user record.

src/Schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var defaultColumns = {
6767
"icon": {type:'File'},
6868
"order": {type:'Number'},
6969
"title": {type:'String'},
70-
"subtile": {type:'String'},
70+
"subtitle": {type:'String'},
7171
}
7272
};
7373

0 commit comments

Comments
 (0)