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:
@@ -60,7 +60,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import clonedeep from 'clone-deep'
|
||||
import draggable from 'vuedraggable'
|
||||
import OpenFormButton from './OpenFormButton.vue'
|
||||
@@ -293,8 +292,8 @@ export default {
|
||||
return null
|
||||
}
|
||||
await this.recordsStore.loadRecord(
|
||||
axios.get('/api/forms/' + this.form.slug + '/submissions/' + this.form.submission_id).then((response) => {
|
||||
return { submission_id: this.form.submission_id, ...response.data.data }
|
||||
opnFetch('/forms/' + this.form.slug + '/submissions/' + this.form.submission_id).then((data) => {
|
||||
return { submission_id: this.form.submission_id, ...data.data }
|
||||
})
|
||||
)
|
||||
return this.recordsStore.getById(this.form.submission_id)
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import { Line as LineChart } from 'vue-chartjs'
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import { computed } from 'vue'
|
||||
import QuestionsEditor from './QuestionsEditor.vue'
|
||||
|
||||
@@ -175,9 +174,9 @@ export default {
|
||||
},
|
||||
async deleteFormTemplate () {
|
||||
if (!this.template) return
|
||||
axios.delete('/api/templates/' + this.template.id).then((response) => {
|
||||
if (response.data.message) {
|
||||
this.useAlert.success(response.data.message)
|
||||
opnFetch('/templates/' + this.template.id, {method:'DELETE'}).then((data) => {
|
||||
if (data.message) {
|
||||
this.useAlert.success(data.message)
|
||||
}
|
||||
this.$router.push({ name: 'templates' })
|
||||
this.templatesStore.remove(this.template)
|
||||
|
||||
Reference in New Issue
Block a user