Instantly share code, notes, and snippets.

Embed
What would you like to do?
ACLs in the addTodo method
// addTodo method of the HomeComponent.
// Rest of the code found on the repo: https://github.com/considine/parse-vue-starter/blob/master/js/app.js
addTodo() {
if (!this.newTodo || this.newTodo.length === 0) return;
var todo_acl = new Parse.ACL();
todo_acl.setWriteAccess( Parse.User.current(), true);
todo_acl.setPublicReadAccess( true);
var todoParseObject = new Parse.Object("Todo", {
"text": this.newTodo
});
todoParseObject.setACL(todo_acl);
todoParseObject.save()
.then((newTodo) => {
this.todos = [newTodo].concat(this.todos);
this.newTodo = "";
})
.catch((function (e) {
alert("Error saving todo! " + e.message);
}))
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment