mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-14 20:34:06 +01:00
Edit and Create forms send to index in edit mode
This commit is contained in:
parent
bd54b53647
commit
552773ab81
3
resources/js/app.js
vendored
3
resources/js/app.js
vendored
@ -24,7 +24,8 @@ const router = new VueRouter({
|
||||
{
|
||||
path: '/',
|
||||
name: 'accounts',
|
||||
component: Accounts
|
||||
component: Accounts,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
|
@ -81,11 +81,14 @@
|
||||
accounts : [],
|
||||
ShowTwofaccountInModal : false,
|
||||
twofaccount: {},
|
||||
editMode : false,
|
||||
token : null,
|
||||
username : null,
|
||||
editMode: this.InitialEditMode
|
||||
}
|
||||
},
|
||||
|
||||
props: ['InitialEditMode'],
|
||||
|
||||
mounted(){
|
||||
this.token = localStorage.getItem('jwt')
|
||||
this.username = localStorage.getItem('user')
|
||||
@ -109,7 +112,9 @@
|
||||
this.$refs.OneTimePassword.clearOTP()
|
||||
});
|
||||
|
||||
this.editMode = this.$router.params.editMode
|
||||
},
|
||||
|
||||
components: {
|
||||
Modal,
|
||||
TwofaccountShow,
|
||||
|
@ -56,7 +56,7 @@
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<router-link :to="{ name: 'accounts' }" class="button is-light">Cancel</router-link>
|
||||
<router-link :to="{ name: 'accounts', params: { InitialEditMode: true } }" class="button is-light">Cancel</router-link>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-link">Create</button>
|
||||
@ -90,7 +90,7 @@
|
||||
axios.defaults.headers.common['Authorization'] = 'Bearer ' + token
|
||||
|
||||
axios.post('/api/twofaccounts', this.twofaccount).then(response => {
|
||||
this.$router.push({name: 'accounts'});
|
||||
this.$router.push({name: 'accounts', params: { InitialEditMode: true }});
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<router-link :to="{ name: 'accounts' }" class="button is-light">Cancel</router-link>
|
||||
<router-link :to="{ name: 'accounts', params: { InitialEditMode: true } }" class="button is-light">Cancel</router-link>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-link">Save</button>
|
||||
@ -80,7 +80,7 @@
|
||||
axios.defaults.headers.common['Authorization'] = 'Bearer ' + token
|
||||
|
||||
axios.put('/api/twofaccounts/' + this.$route.params.twofaccountId, this.twofaccount).then(response => {
|
||||
this.$router.push({name: 'accounts'});
|
||||
this.$router.push({name: 'accounts', params: { InitialEditMode: true }});
|
||||
})
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user