fix(tasks): show any errors happening during task load
This commit is contained in:
parent
925f2aa837
commit
e5f631af8d
@ -3,6 +3,7 @@ import {useRoute} from 'vue-router'
|
|||||||
|
|
||||||
import TaskCollectionService from '@/services/taskCollection'
|
import TaskCollectionService from '@/services/taskCollection'
|
||||||
import type {ITask} from '@/modelTypes/ITask'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
import {error} from '@/message'
|
||||||
|
|
||||||
// FIXME: merge with DEFAULT_PARAMS in filters.vue
|
// FIXME: merge with DEFAULT_PARAMS in filters.vue
|
||||||
export const getDefaultParams = () => ({
|
export const getDefaultParams = () => ({
|
||||||
@ -76,7 +77,11 @@ export function useTaskList(listId, sortByDefault = SORT_BY_DEFAULT) {
|
|||||||
const tasks = ref<ITask[]>([])
|
const tasks = ref<ITask[]>([])
|
||||||
async function loadTasks() {
|
async function loadTasks() {
|
||||||
tasks.value = []
|
tasks.value = []
|
||||||
|
try {
|
||||||
tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value)
|
tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value)
|
||||||
|
} catch (e) {
|
||||||
|
error(e)
|
||||||
|
}
|
||||||
return tasks.value
|
return tasks.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user