refactor: Rewrite the composable to a helper method
This commit is contained in:
@@ -3,7 +3,7 @@ import { useVuelidate } from '@vuelidate/core';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import { required, minLength, email } from '@vuelidate/validators';
|
||||
import { useGlobalConfig } from 'shared/composables/useGlobalConfig';
|
||||
import { useInstallationName } from 'shared/helpers/installationHelper';
|
||||
import FormInput from '../../../../components/Form/Input.vue';
|
||||
import { resetPassword } from '../../../../api/auth';
|
||||
import SubmitButton from '../../../../components/Button/SubmitButton.vue';
|
||||
@@ -11,8 +11,7 @@ import SubmitButton from '../../../../components/Button/SubmitButton.vue';
|
||||
export default {
|
||||
components: { FormInput, SubmitButton },
|
||||
setup() {
|
||||
const { useInstallationName } = useGlobalConfig();
|
||||
return { v$: useVuelidate(), useInstallationName };
|
||||
return { v$: useVuelidate() };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -37,6 +36,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
showAlertMessage(message) {
|
||||
// Reset loading, current selected agent
|
||||
this.resetPassword.showLoading = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { useGlobalConfig } from 'shared/composables/useGlobalConfig';
|
||||
import { useInstallationName } from 'shared/helpers/installationHelper';
|
||||
import SignupForm from './components/Signup/Form.vue';
|
||||
import Testimonials from './components/Testimonials/Index.vue';
|
||||
import Spinner from 'shared/components/Spinner.vue';
|
||||
@@ -11,12 +11,6 @@ export default {
|
||||
Spinner,
|
||||
Testimonials,
|
||||
},
|
||||
setup() {
|
||||
const { useInstallationName } = useGlobalConfig();
|
||||
return {
|
||||
useInstallationName,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return { isLoading: false };
|
||||
},
|
||||
@@ -30,6 +24,7 @@ export default {
|
||||
this.isLoading = this.isAChatwootInstance;
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
resizeContainers() {
|
||||
this.isLoading = false;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user