-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Description
In the Create.js file we find the following code:
const { data, error } = await supabase
.from('recipes')
.insert([{ title, method, rating }])
if (error) {
console.log(error)
setFormError('Please fill in all the fields correctly.')
}
if (data) {
console.log(data)
setFormError(null)
navigate('/')
}
}Yet insert doesn't provide a data object (anymore?). Therefore datais always undefined and the positive if-branch won't run.
Solution:
In the if-branch simply replace the oc
de like this:
if (error) {
console.log(error)
setFormError('Please fill in all the fields correctly.')
} else {
setFormError(null)
navigate('/')
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels