-
-
Save reaganmcf/75bef6e116c5d5ca432395c110f58d84 to your computer and use it in GitHub Desktop.
getChores 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
/** | |
* Retrieve all chores from the bucket | |
*/ | |
const getChores = async function() { | |
const choreData = await choreBucket | |
.getObjects({}) | |
.then(data => { | |
return data; | |
}) | |
.catch(err => { | |
console.log(err); | |
return null; | |
}); | |
let chores = []; | |
if (!choreData) { | |
return []; | |
} else { | |
choreData.objects.map(item => { | |
chores.push(item.title); | |
}); | |
return chores; | |
} | |
}; | |
//update module.exports | |
module.exports = { | |
getChores | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment