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"> <v-dialog v-model="dialogComment">
<form-comment <form-comment
:doc-id="docId"
:example-id="docId"
@click:cancel="dialogComment=false" @click:cancel="dialogComment=false"
/> />
</v-dialog> </v-dialog>

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

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

Loading…
Cancel
Save