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

Fix pending submission, editabe submission & more #306

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions client/components/open/forms/OpenCompleteForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ export default {
window.parent.postMessage(payload, '*')
}
window.postMessage(payload, '*')

try {
this.pendingSubmission.remove()
} catch (e) {}
this.pendingSubmission.remove()

if (data.redirect && data.redirect_url) {
window.location.href = data.redirect_url
Expand Down
2 changes: 1 addition & 1 deletion client/components/open/forms/OpenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default {
}
await this.recordsStore.loadRecord(
opnFetch('/forms/' + this.form.slug + '/submissions/' + this.form.submission_id).then((data) => {
return { submission_id: this.form.submission_id, ...data.data }
return { submission_id: this.form.submission_id, id: this.form.submission_id,...data.data }
})
)
return this.recordsStore.getByKey(this.form.submission_id)
Expand Down
5 changes: 3 additions & 2 deletions client/composables/forms/pendingSubmission.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const pendingSubmission = (form) => {

const set = (value) => {
if (process.server || !enabled.value) return
useStorage(formPendingSubmissionKey.value).value = JSON.stringify(value)
useStorage(formPendingSubmissionKey.value).value = value === null ? value : JSON.stringify(value)
}

const remove = () => {
Expand All @@ -29,6 +29,7 @@ export const pendingSubmission = (form) => {
return {
enabled,
set,
get
get,
remove
}
}
1 change: 1 addition & 0 deletions client/pages/forms/[slug]/show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const workspacesStore = useWorkspacesStore()

const slug = useRoute().params.slug

formsStore.startLoading()
const user = computed(() => authStore.user)
const form = computed(() => formsStore.getByKey(slug))
const workspace = computed(() => workspacesStore.getByKey(form?.value?.workspace_id))
Expand Down
Loading