Skip to content

Instantly share code, notes, and snippets.

@reaganmcf
Last active August 30, 2018 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reaganmcf/1dd249323c19f47f152e85ca563555d8 to your computer and use it in GitHub Desktop.
Save reaganmcf/1dd249323c19f47f152e85ca563555d8 to your computer and use it in GitHub Desktop.
addChore func added
/**
* Add a chore to the bucket
*/
const addChore = async function(chore) {
const params = {
title: chore,
type_slug: 'chores',
content: null
};
var returnData = await choreBucket
.addObject(params)
.then(data => {
return data;
})
.catch(err => {
console.log(err);
return null;
});
return !!returnData;
};
//Update module.exports
module.exports = {
getChores,
addChore
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment