cbothner/react-activestorage-provider

onSubmit - return response

jdarnok opened this issue · 3 comments

Hey! This package works great, but I'm dealing with one issue.
onSubmit is only returning the payload while onError returns the response. For me this consistency is important because of the header token authorization that I'm using - every response has a fresh token that my client is obligated to use in the next response. I can get this flow to work when uploading fails because of reasons but I can't do the same thing with the successful upload - it never reaches this callback.
In short:

  onSubmit(request) {
    console.log('request', request.headers);
  }

Is always undefined.

Did you solve this @jdarnok?

How did you solve this? @jdarnok

@nomgains @vnhnhm Sorry for lete response:

  • No, I haven't. I am catching every response using other packages and handling it there.