Parse.Relation.add and Parse.Relation.remove can accept a Array of Parse.Object

This commit is contained in:
Flavio Torres
2017-09-26 23:52:20 -03:00
parent cc1d75836f
commit e3a835a4dc
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -280,13 +280,13 @@ declare namespace Parse {
constructor(parent?: S, key?: string);
//Adds a Parse.Object or an array of Parse.Objects to the relation.
add(object: T): void;
add(object: T | Array<T>): void;
// Returns a Parse.Query that is limited to objects in this relation.
query(): Query<T>;
// Removes a Parse.Object or an array of Parse.Objects from this relation.
remove(object: T): void;
remove(object: T | Array<T>): void;
}
/**
+8
View File
@@ -227,7 +227,15 @@ function test_analytics() {
}
function test_relation() {
var game1 = new Game();
var game2 = new Game();
new Parse.User().relation("games").query().find().then((g: Game[]) => { });
new Parse.User().relation("games").add(game1)
new Parse.User().relation("games").add([game1, game2])
new Parse.User().relation("games").remove(game1)
new Parse.User().relation("games").remove([game1, game2])
}
function test_user_acl_roles() {