diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index 3ed3044b..76a0fb23 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -209,7 +209,7 @@ function resize() { store.commit(MENU_ACTIVE, window.innerWidth >= 770) } -function toggleLists(namespaceId: number) { +function toggleLists(namespaceId: NamespaceModel['id']) { listsVisible.value[namespaceId] = !listsVisible.value[namespaceId] } diff --git a/src/components/input/fancycheckbox.vue b/src/components/input/fancycheckbox.vue index 204efeec..31380bf9 100644 --- a/src/components/input/fancycheckbox.vue +++ b/src/components/input/fancycheckbox.vue @@ -53,7 +53,7 @@ export default defineComponent({ }, }, methods: { - updateData(checked) { + updateData(checked: boolean) { this.checked = checked this.$emit('update:modelValue', checked) this.$emit('change', checked) diff --git a/src/components/sharing/linkSharing.vue b/src/components/sharing/linkSharing.vue index 74cae27a..b38a5834 100644 --- a/src/components/sharing/linkSharing.vue +++ b/src/components/sharing/linkSharing.vue @@ -182,6 +182,7 @@ import {useI18n} from 'vue-i18n' import {RIGHTS} from '@/models/constants/rights' import LinkShareModel from '@/models/linkShare' +import type ListModel from '@/models/list' import LinkShareService from '@/services/linkShare' @@ -216,7 +217,7 @@ watch( const store = useStore() const frontendUrl = computed(() => store.state.config.frontendUrl) -async function load(listId) { +async function load(listId: ListModel['id']) { // If listId == 0 the list on the calling component wasn't already loaded, so we just bail out here if (listId === 0) { return @@ -225,7 +226,7 @@ async function load(listId) { linkShares.value = await linkShareService.getAll({listId}) } -async function add(listId) { +async function add(listId: ListModel['id']) { const newLinkShare = new LinkShareModel({ right: selectedRight.value, listId, @@ -241,7 +242,7 @@ async function add(listId) { await load(listId) } -async function remove(listId) { +async function remove(listId: ListModel['id']) { try { await linkShareService.delete(new LinkShareModel({ id: linkIdToDelete.value, diff --git a/src/components/sharing/userTeam.vue b/src/components/sharing/userTeam.vue index 6920102c..c14902aa 100644 --- a/src/components/sharing/userTeam.vue +++ b/src/components/sharing/userTeam.vue @@ -355,7 +355,7 @@ async function toggleType(sharable) { const found = ref([]) const currentUserId = computed(() => store.state.auth.info.id) -async function find(query) { +async function find(query: string) { if (query === '') { found.value = [] return diff --git a/src/components/tasks/partials/attachments.vue b/src/components/tasks/partials/attachments.vue index 1a2c0f68..4f3292ef 100644 --- a/src/components/tasks/partials/attachments.vue +++ b/src/components/tasks/partials/attachments.vue @@ -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() { diff --git a/src/components/tasks/partials/comments.vue b/src/components/tasks/partials/comments.vue index 9efe0d2a..8f889e98 100644 --- a/src/components/tasks/partials/comments.vue +++ b/src/components/tasks/partials/comments.vue @@ -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 } diff --git a/src/components/tasks/partials/relatedTasks.vue b/src/components/tasks/partials/relatedTasks.vue index c1d5c629..a46c4f63 100644 --- a/src/components/tasks/partials/relatedTasks.vue +++ b/src/components/tasks/partials/relatedTasks.vue @@ -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}) }, diff --git a/src/components/tasks/partials/singleTaskInList.vue b/src/components/tasks/partials/singleTaskInList.vue index 209633b6..6cc341d6 100644 --- a/src/components/tasks/partials/singleTaskInList.vue +++ b/src/components/tasks/partials/singleTaskInList.vue @@ -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) }, diff --git a/src/services/accountDelete.ts b/src/services/accountDelete.ts index c4f443cf..52e922ca 100644 --- a/src/services/accountDelete.ts +++ b/src/services/accountDelete.ts @@ -1,15 +1,15 @@ import AbstractService from './abstractService' export default class AccountDeleteService extends AbstractService { - request(password) { - return this.post('/user/deletion/request', {password: password}) + request(password: string) { + return this.post('/user/deletion/request', {password}) } - confirm(token) { - return this.post('/user/deletion/confirm', {token: token}) + confirm(token: string) { + return this.post('/user/deletion/confirm', {token}) } - cancel(password) { - return this.post('/user/deletion/cancel', {password: password}) + cancel(password: string) { + return this.post('/user/deletion/cancel', {password}) } } \ No newline at end of file diff --git a/src/services/backgroundUpload.ts b/src/services/backgroundUpload.ts index 8f9dcf62..0f9d9792 100644 --- a/src/services/backgroundUpload.ts +++ b/src/services/backgroundUpload.ts @@ -22,9 +22,9 @@ export default class BackgroundUploadService extends AbstractService { * @param file * @returns {Promise} */ - create(listId, file) { + create(listId: ListModel['id'], file) { return this.uploadFile( - this.getReplacedRoute(this.paths.create, {listId: listId}), + this.getReplacedRoute(this.paths.create, {listId}), file, 'background', ) diff --git a/src/services/dataExport.ts b/src/services/dataExport.ts index 9f8720bf..3c4064ac 100644 --- a/src/services/dataExport.ts +++ b/src/services/dataExport.ts @@ -2,11 +2,11 @@ import AbstractService from './abstractService' import {downloadBlob} from '../helpers/downloadBlob' export default class DataExportService extends AbstractService { - request(password) { - return this.post('/user/export/request', {password: password}) + request(password: string) { + return this.post('/user/export/request', {password}) } - async download(password) { + async download(password: string) { const clear = this.setLoading() try { const url = await this.getBlobUrl('/user/export/download', 'POST', {password}) diff --git a/src/views/filters/FilterDelete.vue b/src/views/filters/FilterDelete.vue index 15238ec0..0f2c6fbf 100644 --- a/src/views/filters/FilterDelete.vue +++ b/src/views/filters/FilterDelete.vue @@ -27,7 +27,7 @@ const route = useRoute() async function deleteSavedFilter() { // We assume the listId in the route is the pseudolist - const savedFilterId = getSavedFilterIdFromListId(route.params.listId) + const savedFilterId = getSavedFilterIdFromListId(Number((route.params.listId as string))) const filterService = new SavedFilterService() const filter = new SavedFilterModel({id: savedFilterId}) diff --git a/src/views/filters/FilterEdit.vue b/src/views/filters/FilterEdit.vue index 9f978b17..5e896470 100644 --- a/src/views/filters/FilterEdit.vue +++ b/src/views/filters/FilterEdit.vue @@ -52,11 +52,12 @@