mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Merge pull request #23786 from percypyan/patch-1
Add ParseObject's revert() method in @types/parse
This commit is contained in:
1
types/parse/index.d.ts
vendored
1
types/parse/index.d.ts
vendored
@@ -377,6 +377,7 @@ declare namespace Parse {
|
||||
previousAttributes(): any;
|
||||
relation(attr: string): Relation<this, Object>;
|
||||
remove(attr: string, item: any): any;
|
||||
revert(): void;
|
||||
save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise<this>;
|
||||
save(key: string, value: any, options?: Object.SaveOptions): Promise<this>;
|
||||
save(attrs: object, options?: Object.SaveOptions): Promise<this>;
|
||||
|
||||
@@ -288,7 +288,13 @@ function test_user_acl_roles() {
|
||||
game.setACL(new Parse.ACL(Parse.User.current()));
|
||||
game.save().then((game: Game) => { });
|
||||
game.save(null, { useMasterKey: true });
|
||||
game.save({ score: '10' }, { useMasterKey: true });
|
||||
game.save({ score: '10' }, { useMasterKey: true }).then(function (game) {
|
||||
// Update game then revert it to the last saved state.
|
||||
game.set("score", '20');
|
||||
game.revert();
|
||||
}, function (error) {
|
||||
// The save failed
|
||||
});
|
||||
|
||||
const groupACL = new Parse.ACL();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user