Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const toggleTodo = async (username, todo, handleRemoveUserAuthentication) => {
try {
const markingComplete = !todo.item.completed
await userbase.update(getDbName(username), { todo: todo.item.todo, completed: markingComplete }, todo.itemId)
} catch (e) {
_errorHandler(e, 'toggle todos', handleRemoveUserAuthentication)
}
}