Migrate to nuxt settings page AND remove axios (#266)

* Settings pages migration

* remove axios and use opnFetch

* Make created form reactive (#267)

* Remove verify pages and axios lib

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
formsdev
2024-01-02 17:39:41 +05:30
committed by GitHub
parent 6fd2985ff5
commit 178424a184
27 changed files with 622 additions and 888 deletions

View File

@@ -76,7 +76,6 @@
</template>
<script>
import axios from 'axios'
import { inputProps, useFormInput } from './useFormInput.js'
import InputWrapper from './components/InputWrapper.vue'
import UploadedFile from './components/UploadedFile.vue'
@@ -193,13 +192,14 @@ export default {
}
if (this.moveToFormAssets) {
// Move file to permanent storage for form assets
axios.post('/api/open/forms/assets/upload', {
opnFetch('/open/forms/assets/upload', {
method: 'POST',
type: 'files',
url: file.name.split('.').slice(0, -1).join('.') + '_' + response.uuid + '.' + response.extension
}).then(moveFileResponse => {
}).then(moveFileResponseData => {
this.files.push({
file: file,
url: moveFileResponse.data.url,
url: moveFileResponseData.url,
src: this.getFileSrc(file)
})
this.loading = false

View File

@@ -107,7 +107,6 @@
</template>
<script>
import axios from 'axios'
import { inputProps, useFormInput } from './useFormInput.js'
import InputWrapper from './components/InputWrapper.vue'
import Modal from '../global/Modal.vue'
@@ -190,13 +189,14 @@ export default {
// Store file in s3
this.storeFile(this.file).then(response => {
// Move file to permanent storage for form assets
axios.post('/api/open/forms/assets/upload', {
opnFetch('/open/forms/assets/upload', {
method: 'POST',
url: this.file.name.split('.').slice(0, -1).join('.') + '_' + response.uuid + '.' + response.extension
}).then(moveFileResponse => {
}).then(moveFileResponseData => {
if (!this.multiple) {
this.files = []
}
this.compVal = moveFileResponse.data.url
this.compVal = moveFileResponseData.url
this.showUploadModal = false
this.loading = false
}).catch((error) => {