forked from vikunja/frontend
name -> title, cleanup
This commit is contained in:
parent
4214ab3c92
commit
0506cc8726
@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<div class="fullpage">
|
||||
<a @click="back()" class="close">
|
||||
<icon :icon="['far', 'times-circle']">
|
||||
</icon>
|
||||
<icon :icon="['far', 'times-circle']"/>
|
||||
</a>
|
||||
<h3>Create a new label</h3>
|
||||
<form @keyup.esc="back()" @submit.prevent="newlabel">
|
||||
@ -11,7 +10,7 @@
|
||||
<input
|
||||
:class="{ 'disabled': labelService.loading }"
|
||||
class="input"
|
||||
placeholder="The label name goes here..." type="text"
|
||||
placeholder="The label title goes here..." type="text"
|
||||
v-focus
|
||||
v-model="label.title"/>
|
||||
</p>
|
||||
@ -25,14 +24,13 @@
|
||||
</p>
|
||||
</div>
|
||||
<p class="help is-danger" v-if="showError && label.title === ''">
|
||||
Please specify a name.
|
||||
Please specify a title.
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from '../../router'
|
||||
import labelModel from '../../models/label'
|
||||
import labelService from '../../services/label'
|
||||
import {IS_FULLPAGE} from '@/store/mutation-types'
|
||||
@ -65,11 +63,9 @@ export default {
|
||||
}
|
||||
this.showError = false
|
||||
|
||||
console.log(this.label);
|
||||
|
||||
this.labelService.create(this.label)
|
||||
.then(response => {
|
||||
router.push({name: 'labels.index', params: {id: response.id}})
|
||||
this.$router.push({name: 'labels.index', params: {id: response.id}})
|
||||
this.success({message: 'The label was successfully created.'}, this)
|
||||
})
|
||||
.catch(e => {
|
||||
@ -77,7 +73,7 @@ export default {
|
||||
})
|
||||
},
|
||||
back() {
|
||||
router.go(-1)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user