Merge pull request #485 from nextcloud/fix/475/emptycontent-on-delete-answers

Fix questions & submissions assignment
This commit is contained in:
John Molakvoæ 2020-07-07 11:21:53 +02:00 committed by GitHub
commit b7e9448cf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,17 +172,19 @@ export default {
async loadFormResults() {
this.loadingResults = true
console.debug('Loading Results')
console.debug('Loading results for form', this.form.hash)
try {
const response = await axios.get(generateUrl('/apps/forms/api/v1/submissions/{hash}', {
hash: this.form.hash,
}))
this.form.submissions = response.data.submissions
this.form.questions = response.data.questions
// Append questions & submissions
this.$set(this.form, 'submissions', response.data.submissions)
this.$set(this.form, 'questions', response.data.questions)
} catch (error) {
console.error(error)
showError(t('forms', 'There was an error while loading results'))
showError(t('forms', 'There was an error while loading the results'))
} finally {
this.loadingResults = false
}