Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend not sending data to backend #12

Open
ibevers opened this issue Oct 28, 2024 · 8 comments
Open

Frontend not sending data to backend #12

ibevers opened this issue Oct 28, 2024 · 8 comments

Comments

@ibevers
Copy link
Collaborator

ibevers commented Oct 28, 2024

No description provided.

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

Screenshot 2024-10-28 at 11 33 50 AM

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

Screenshot 2024-10-28 at 11 34 25 AM

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

In Survey.vue, the /submit endpoint is triggered when the next activity button is called:
<b-button v-if="nextActivity[activityUrl]" variant="danger" @click="nextActivity1">{{ $t('next-button')}}
@click="nextActivity1"

Method: nextActivity1()
Calls: uploadZipData()

Method: uploadZipData()
Calls: formatData(data)

Method: formatData(data)
Calls: sendRetry(url, formData)

Method: sendRetry(url, formData, retries = 3, backoff = 10000)
Executes (asynchronously): axios.post(url, formData, config1)
Endpoint: /submit

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

In SaveData.vue, the /submit endpoint is triggered when one of these buttons is clicked:
<b-button v-if="downloadAndSubmit" @click="upload" variant="danger" ref="upload">
{{ $t('download-and-submit-button')}}

<b-button v-else @click="upload" variant="danger" ref="upload">
{{ $t('upload-button')}}

@click="upload"

Method: upload()
Calls: uploadZipData()

Method: uploadZipData()
Calls: formatData(totalResponse)

Method: formatData(data)
Creates a ZIP file of the responses
Slices the ZIP file into chunks
For each chunk, calls: sendRetry(url, formData, index)

Method: sendRetry(url, formData, index, retries = 3, backoff = 10000)
Executes (asynchronously): axios.post(url, formData, config1)
Endpoint: /submit

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

In App.vue, if the relevant section was not commmented out, the /submit endpoint would be triggered during the mounted() lifecycle hook:
Lifecycle Hook: mounted()
Checks if auth_token exists
Prepares formData with auth_token
Calls: axios.post(url, formData, config1)

Method: axios.post(url, formData, config1)
Endpoint: /submit

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

Before clicking the Next button:
Screenshot 2024-10-28 at 12 12 08 PM

After clicking the Next button:
Screenshot 2024-10-28 at 12 12 51 PM

No calls were made to the backend.

@satra
Copy link
Contributor

satra commented Oct 28, 2024

if as you say this executes: #12 (comment) what url is being called and if a url is called it should be sending data there.

@ibevers
Copy link
Collaborator Author

ibevers commented Oct 28, 2024

@satra I think my phrasing may have been a bit confusing--that analysis was just from reading the code. It does not appear to call a URL when actually running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants