#.then() runs before promise is resolved

2 messages · Page 1 of 1 (latest)

dull tinsel
#
    await hostRecipeImage
      .then(() => {
        hostStepImages
      })
      .then(() => {
        console.log(object)
        setRecipe(object)
      })
      .then(
        await fetch("/api/rezept-upload", {
          method: "post",
          body: JSON.stringify(recipe),
          credentials: "include",
        })

my fetch method runs immediately before the hostRecipeImage promise gets resolved, any idea why?

lusty remnant
#

what is hostRecipeImage? Seems like there is some invalid syntax here