diff --git a/resources/js/views/Groups.vue b/resources/js/views/Groups.vue index 70408c48..416f34e7 100644 --- a/resources/js/views/Groups.vue +++ b/resources/js/views/Groups.vue @@ -15,10 +15,12 @@
{{ group.name }} + - + + {{ $t('commons.rename') }} {{ group.count }} {{ $t('twofaccounts.accounts') }} diff --git a/resources/js/views/groups/Edit.vue b/resources/js/views/groups/Edit.vue index 719999e7..9e5a4e2b 100644 --- a/resources/js/views/groups/Edit.vue +++ b/resources/js/views/groups/Edit.vue @@ -21,40 +21,29 @@ export default { data() { return { - groupExists: false, form: new Form({ - name: '', + name: this.name, }) } }, - created: function() { - this.getGroup(); - }, + props: ['id', 'name'], methods: { - async getGroup () { - - const { data } = await this.axios.get('/api/groups/' + this.$route.params.groupId) - - this.form.fill(data) - this.groupExists = true - - }, async updateGroup() { - await this.form.put('/api/groups/' + this.$route.params.groupId) + await this.form.put('/api/groups/' + this.id) if( this.form.errors.any() === false ) { - this.$router.push({name: 'groups', params: { InitialEditMode: true }}) + this.$router.push({ name: 'groups' }) } }, cancelCreation: function() { - this.$router.push({name: 'groups', params: { InitialEditMode: true }}); + this.$router.push({ name: 'groups' }); }, },