add eslint working conf
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div class="flex justify-between mb-4">
|
||||
<router-link :to="'/memos/' + this.$route.params.id" class="btn">< Back</router-link>
|
||||
<router-link :to="'/memos/' + this.$route.params.id" class="btn">Back</router-link>
|
||||
</div>
|
||||
<form @submit.prevent="submitForm">
|
||||
<InputField name="name" :data="form.name" label="Title" placeholder="Your Title" required @update:field="form.name = $event" :errors="errors" />
|
||||
@@ -31,49 +31,51 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InputField from "../../components/InputField";
|
||||
import TextAreaField from "../../components/TextAreaField";
|
||||
import UploadableImage from "../../components/UploadableImage";
|
||||
import InputField from '../../components/InputField'
|
||||
import TextAreaField from '../../components/TextAreaField'
|
||||
import UploadableImage from '../../components/UploadableImage'
|
||||
|
||||
export default {
|
||||
name: "MemoEdit",
|
||||
components: {
|
||||
InputField, TextAreaField, UploadableImage
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
form: {
|
||||
'name': '',
|
||||
'memo': '',
|
||||
'attributes': {}
|
||||
},
|
||||
errors: null,
|
||||
loading: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm: function () {
|
||||
axios.patch('/api/memos/' + this.$route.params.id, this.form)
|
||||
.then(response => {
|
||||
this.$router.push(response.data.links.self)
|
||||
})
|
||||
.catch(errors => {
|
||||
this.errors = errors.response.data.errors
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
axios.get('/api/memos/' + this.$route.params.id)
|
||||
export default {
|
||||
name: 'MemoEdit',
|
||||
components: {
|
||||
InputField, TextAreaField, UploadableImage
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
form: {
|
||||
'name': '',
|
||||
'memo': '',
|
||||
'attributes': {}
|
||||
},
|
||||
errors: null,
|
||||
loading: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm: function () {
|
||||
// eslint-disable-next-line no-undef
|
||||
axios.patch('/api/memos/' + this.$route.params.id, this.form)
|
||||
.then(response => {
|
||||
this.form = response.data.data
|
||||
this.loading = false
|
||||
this.$router.push(response.data.links.self)
|
||||
})
|
||||
.catch(error => {
|
||||
this.loading = false
|
||||
if (error.response.status === 404) {
|
||||
this.$router.back()
|
||||
}
|
||||
.catch(errors => {
|
||||
this.errors = errors.response.data.errors
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// eslint-disable-next-line no-undef
|
||||
axios.get('/api/memos/' + this.$route.params.id)
|
||||
.then(response => {
|
||||
this.form = response.data.data
|
||||
this.loading = false
|
||||
})
|
||||
.catch(error => {
|
||||
this.loading = false
|
||||
if (error.response.status === 404) {
|
||||
this.$router.back()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user