Ancora sistemazioni Typescript... getters, mutations, actions... "@" alias.
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
|
||||
import {mapActions} from 'vuex'
|
||||
import * as types from '../../store/mutation-types'
|
||||
//import {ErroriMongoDb} from '../../store/Modules/user'
|
||||
import { rescodes } from '../../../store/Modules/rescodes'
|
||||
|
||||
import {serv_constants} from '../../store/Modules/serv_constants';
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
import {mapGetters, mapActions} from 'vuex'
|
||||
import * as types from '../../store/mutation-types'
|
||||
|
||||
//import {ErroriMongoDb} from '../../store/Modules/user'
|
||||
import { rescodes } from '../../../store/Modules/rescodes'
|
||||
import {serv_constants} from "../../store/Modules/serv_constants";
|
||||
import axios from 'axios';
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
},
|
||||
checkErrors(riscode) {
|
||||
//console.log("RIS = " + riscode);
|
||||
if (riscode === ErroriMongoDb.OK) {
|
||||
if (riscode === rescodes.OK) {
|
||||
this.showNotif({type: 'positive', message: this.$t('login.completato')});
|
||||
this.$router.push('/');
|
||||
} else if (riscode === serv_constants.RIS_CODE_LOGIN_ERR) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
import { User } from '@store'
|
||||
import { ErroriMongoDb } from 'store/Modules/user'
|
||||
import { UserStore } from '@store'
|
||||
import { rescodes } from '../../../store/Modules/rescodes'
|
||||
|
||||
import { required, email, numeric, maxLength, maxValue, minValue, sameAs, minLength } from 'vuelidate/lib/validators'
|
||||
import { ISignupOptions, IUserState } from 'model'
|
||||
@@ -131,11 +131,11 @@ export default class Signup extends Vue {
|
||||
|
||||
checkErrors(riscode: number) {
|
||||
// console.log("RIS = " + riscode);
|
||||
if (riscode === ErroriMongoDb.DUPLICATE_EMAIL_ID) {
|
||||
if (riscode === rescodes.DUPLICATE_EMAIL_ID) {
|
||||
this.showNotif(this.$t('reg.err.duplicate_email'))
|
||||
} else if (riscode === ErroriMongoDb.DUPLICATE_USERNAME_ID) {
|
||||
} else if (riscode === rescodes.DUPLICATE_USERNAME_ID) {
|
||||
this.showNotif(this.$t('reg.err.duplicate_username'))
|
||||
} else if (riscode === ErroriMongoDb.OK) {
|
||||
} else if (riscode === rescodes.OK) {
|
||||
this.$router.push('/')
|
||||
} else {
|
||||
this.showNotif('Errore num ' + riscode)
|
||||
@@ -162,7 +162,7 @@ export default class Signup extends Vue {
|
||||
this.$q.loading.show({ message: this.$t('reg.incorso') })
|
||||
|
||||
console.log(this.signup)
|
||||
User.actions.signup(this.signup)
|
||||
UserStore.actions.signup(this.signup)
|
||||
.then((riscode) => {
|
||||
this.checkErrors(riscode)
|
||||
this.$q.loading.hide()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Watch } from 'vue-property-decorator';
|
||||
import { UserModule } from '../../store/Modules/user';
|
||||
import { UserStore } from '@store';
|
||||
|
||||
|
||||
@Component({})
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
import {mapActions} from 'vuex'
|
||||
import * as types from '../../store/mutation-types'
|
||||
//import {ErroriMongoDb} from '../../store/Modules/user'
|
||||
//import {rescodes} from '../../store/Modules/user'
|
||||
|
||||
import {serv_constants} from '../../store/Modules/serv_constants';
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
import {mapActions} from 'vuex'
|
||||
import * as types from '../../store/mutation-types'
|
||||
//import {ErroriMongoDb} from '../../store/Modules/user'
|
||||
import { rescodes } from '../../../store/Modules/rescodes'
|
||||
|
||||
import {serv_constants} from '../../store/Modules/serv_constants';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user