Browse Source

Rename a prop name from docId to exampleId

pull/1649/head
Hironsan 3 years ago
parent
commit
8eb7c87243
2 changed files with 10 additions and 10 deletions
  1. 2
      frontend/components/tasks/toolbar/ToolbarLaptop.vue
  2. 18
      frontend/components/tasks/toolbar/forms/FormComment.vue

2
frontend/components/tasks/toolbar/ToolbarLaptop.vue

@ -31,7 +31,7 @@
/>
<v-dialog v-model="dialogComment">
<form-comment
:doc-id="docId"
:example-id="docId"
@click:cancel="dialogComment=false"
/>
</v-dialog>

18
frontend/components/tasks/toolbar/forms/FormComment.vue

@ -4,7 +4,7 @@
:cancel-text="$t('generic.close')"
@cancel="$emit('click:cancel')"
>
<template #content>
<template v-if="user.id" #content>
<form-create
@add-comment="add"
/>
@ -35,7 +35,7 @@ export default Vue.extend({
},
props: {
docId: {
exampleId: {
type: Number,
required: true
}
@ -48,12 +48,8 @@ export default Vue.extend({
}
},
async fetch() {
this.user = await this.$services.user.getMyProfile()
},
watch: {
currentDoc: {
exampleId: {
handler(val) {
if (val !== undefined) {
this.list()
@ -64,12 +60,16 @@ export default Vue.extend({
}
},
async created() {
this.user = await this.$services.user.getMyProfile()
},
methods: {
async list() {
this.comments = await this.$services.comment.list(this.$route.params.id, this.docId)
this.comments = await this.$services.comment.list(this.$route.params.id, this.exampleId)
},
async add(message: string) {
await this.$services.comment.create(this.$route.params.id, this.docId, message)
await this.$services.comment.create(this.$route.params.id, this.exampleId, message)
this.list()
},
async remove(item: CommentReadDTO) {

Loading…
Cancel
Save