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