Last active
August 30, 2018 16:51
-
-
Save reaganmcf/1dd249323c19f47f152e85ca563555d8 to your computer and use it in GitHub Desktop.
addChore func added
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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