mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
[tm@modals] Refactoring
This commit is contained in:
1 parent
96954845a1
commit
0a038b7771
19 files changed
+302
-582
No files matched your search
@@ -11,8 +11,8 @@
|
||||
></v-icon>
|
||||
</div>
|
||||
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
||||
<v-btn class="z-btn" variant="flat" @click="complete()">ÁNO</v-btn>
|
||||
<v-btn class="ml-7 cancel-btn" @click.stop="visible = false">ZRUŠIŤ</v-btn>
|
||||
<v-btn class="button primary" variant="flat" @click="complete()">ÁNO</v-btn>
|
||||
<v-btn class="ml-7 button cancel" @click.stop="visible = false">ZRUŠIŤ</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ['close'],
|
||||
emits: ['close', 'task-completed'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
@@ -37,14 +37,9 @@ export default {
|
||||
|
||||
async complete() {
|
||||
try {
|
||||
const task = {
|
||||
...this.task,
|
||||
is_finished: true
|
||||
}
|
||||
|
||||
await this.$axios.post(`v1/tasks/${task.id}`, task)
|
||||
await this.$axios.post(`v1/tasks/${this.task.id}`, {...this.task, is_finished: true})
|
||||
this.visible = false
|
||||
this.$emit('completeTask', task.id)
|
||||
this.$emit('task-completed', this.task)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user