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

@@ -12,7 +12,6 @@
<script>
import { computed } from 'vue'
import axios from 'axios'
import TextInput from '../../forms/TextInput.vue'
import VButton from '~/components/global/VButton.vue'
@@ -81,8 +80,8 @@ export default {
if (this.form.busy) return
this.form.put('api/subscription/update-customer-details').then(() => {
this.loading = true
axios.get('/api/subscription/new/' + this.plan + '/' + (!this.yearly ? 'monthly' : 'yearly') + '/checkout/with-trial').then((response) => {
window.location = response.data.checkout_url
opnFetch('/subscription/new/' + this.plan + '/' + (!this.yearly ? 'monthly' : 'yearly') + '/checkout/with-trial').then((data) => {
window.location = data.checkout_url
}).catch((error) => {
useAlert().error(error.response.data.message)
}).finally(() => {

View File

@@ -109,7 +109,6 @@
<script>
import { computed } from 'vue'
import { useAuthStore } from '../../../stores/auth'
import axios from 'axios'
import MonthlyYearlySelector from './MonthlyYearlySelector.vue'
import CheckoutDetailsModal from './CheckoutDetailsModal.vue'
import CustomPlan from './CustomPlan.vue'
@@ -160,9 +159,9 @@ export default {
},
openBilling () {
this.billingLoading = true
axios.get('/api/subscription/billing-portal').then((response) => {
opnFetch('/subscription/billing-portal').then((data) => {
this.billingLoading = false
const url = response.data.portal_url
const url = data.portal_url
window.location = url
})
}