Fixed most of the form/show pages
This commit is contained in:
13
client/stores/forms.js
vendored
13
client/stores/forms.js
vendored
@@ -9,7 +9,7 @@ export const useFormsStore = defineStore('forms', () => {
|
||||
const allLoaded = ref(false)
|
||||
const currentPage = ref(1)
|
||||
|
||||
const load = (workspaceId) => {
|
||||
const loadAll = (workspaceId) => {
|
||||
contentStore.startLoading()
|
||||
return opnFetch(formsEndpoint.replace('{workspaceId}', workspaceId),{query: {page: currentPage.value}})
|
||||
.then((response) => {
|
||||
@@ -21,7 +21,7 @@ export const useFormsStore = defineStore('forms', () => {
|
||||
}
|
||||
if (currentPage.value < response.meta.last_page) {
|
||||
currentPage.value++
|
||||
load(workspaceId)
|
||||
loadAll(workspaceId)
|
||||
} else {
|
||||
allLoaded.value = true
|
||||
contentStore.stopLoading()
|
||||
@@ -30,6 +30,14 @@ export const useFormsStore = defineStore('forms', () => {
|
||||
})
|
||||
}
|
||||
|
||||
const load = (workspaceId, slug) => {
|
||||
contentStore.startLoading()
|
||||
return opnFetch(formsEndpoint.replace('{workspaceId}', workspaceId) + '/' + slug)
|
||||
.then((response) => {
|
||||
console.log(response.data.value)
|
||||
})
|
||||
}
|
||||
|
||||
const allTags = computed(() => {
|
||||
let tags = []
|
||||
contentStore.getAll.value.forEach((form) => {
|
||||
@@ -44,6 +52,7 @@ export const useFormsStore = defineStore('forms', () => {
|
||||
...contentStore,
|
||||
allLoaded,
|
||||
allTags,
|
||||
loadAll,
|
||||
load
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user