Working on form/show and editor

This commit is contained in:
Julien Nahum
2023-12-24 09:51:22 +01:00
parent 56e533581c
commit d93b696b05
16 changed files with 96 additions and 133 deletions

View File

@@ -27,14 +27,18 @@ export const useFormsStore = defineStore('forms', () => {
contentStore.stopLoading()
currentPage.value = 1
}
}).catch((error) => {
contentStore.stopLoading()
currentPage.value = 1
throw error
})
}
const load = (workspaceId, slug) => {
contentStore.startLoading()
return opnFetch(formsEndpoint.replace('{workspaceId}', workspaceId) + '/' + slug)
.then((response) => {
console.log(response.data.value)
.finally(() => {
contentStore.stopLoading()
})
}

View File

@@ -13,6 +13,8 @@ export const useWorkingFormStore = defineStore('working_form', {
}),
actions: {
set (form) {
console.log('setting working form', form)
console.trace();
this.content = form
},
setProperties (properties) {

View File

@@ -22,7 +22,7 @@ export const useWorkspacesStore = defineStore('workspaces', () => {
const save = (items) => {
contentStore.save(items)
if (currentId.value == null && contentStore.length.value) {
if ((getCurrent.value == null) && contentStore.length.value) {
setCurrentId(items[0].id)
}
}