1
0

feat: function attribute typing

This commit is contained in:
Dominik Pschenitschni
2022-06-23 03:20:07 +02:00
parent 8fb00653e4
commit 332acf012c
17 changed files with 48 additions and 41 deletions

View File

@ -148,6 +148,7 @@ import {defineComponent} from 'vue'
import AttachmentService from '../../../services/attachment'
import AttachmentModel from '../../../models/attachment'
import type FileModel from '@/models/file'
import User from '@/components/misc/user.vue'
import {mapState} from 'vuex'
@ -229,7 +230,7 @@ export default defineComponent({
})
},
methods: {
downloadAttachment(attachment) {
downloadAttachment(attachment: AttachmentModel) {
this.attachmentService.download(attachment)
},
uploadNewAttachment() {
@ -239,7 +240,7 @@ export default defineComponent({
this.uploadFiles(this.$refs.files.files)
},
uploadFiles(files) {
uploadFiles(files: FileModel[]) {
uploadFiles(this.attachmentService, this.taskId, files)
},
async deleteAttachment() {

View File

@ -163,6 +163,7 @@ import TaskCommentModel from '@/models/taskComment'
import {uploadFile} from '@/helpers/attachments'
import {success} from '@/message'
import type TaskModel from '@/models/task'
const props = defineProps({
taskId: {
type: Number,
@ -213,7 +214,7 @@ function attachmentUpload(...args) {
const taskCommentService = shallowReactive(new TaskCommentService())
async function loadComments(taskId) {
async function loadComments(taskId: TaskModel['id']) {
if (!enabled.value) {
return
}
@ -262,7 +263,7 @@ function toggleEdit(comment: TaskCommentModel) {
Object.assign(commentEdit, comment)
}
function toggleDelete(commentId) {
function toggleDelete(commentId: TaskCommentModel['id']) {
showDeleteModal.value = !showDeleteModal.value
commentToDelete.id = commentId
}

View File

@ -220,7 +220,7 @@ export default defineComponent({
},
},
methods: {
async findTasks(query) {
async findTasks(query: string) {
this.query = query
this.foundTasks = await this.taskService.getAll({}, {s: query})
},

View File

@ -186,7 +186,7 @@ export default defineComponent({
},
},
methods: {
async markAsDone(checked) {
async markAsDone(checked: boolean) {
const updateFunc = async () => {
const task = await this.taskService.update(this.task)
if (this.task.done) {
@ -211,7 +211,7 @@ export default defineComponent({
}
},
undoDone(checked) {
undoDone(checked: boolean) {
this.task.done = !this.task.done
this.markAsDone(!checked)
},