diff --git a/src/composables/taskList.ts b/src/composables/taskList.ts index 330f380e4..0c6f09e22 100644 --- a/src/composables/taskList.ts +++ b/src/composables/taskList.ts @@ -1,4 +1,4 @@ -import { ref, shallowReactive, watch, computed } from 'vue' +import {ref, shallowReactive, watch, computed} from 'vue' import {useRoute} from 'vue-router' import TaskCollectionService from '@/services/taskCollection' @@ -20,14 +20,13 @@ const SORT_BY_DEFAULT = { /** * This mixin provides a base set of methods and properties to get tasks on a list. */ -export function useTaskList(listId) { +export function useTaskList(listId, sortByDefault = SORT_BY_DEFAULT) { const params = ref({...getDefaultParams()}) const search = ref('') const page = ref(1) - const sortBy = ref({ ...SORT_BY_DEFAULT }) - + const sortBy = ref({ ...sortByDefault }) // This makes sure an id sort order is always sorted last. // When tasks would be sorted first by id and then by whatever else was specified, the id sort takes diff --git a/src/views/list/ListList.vue b/src/views/list/ListList.vue index 1d60db0f4..1555a3dde 100644 --- a/src/views/list/ListList.vue +++ b/src/views/list/ListList.vue @@ -214,7 +214,9 @@ export default defineComponent({ // isTaskEdit.value = false // } - const taskList = useTaskList(toRef(props, 'listId')) + const taskList = useTaskList(toRef(props, 'listId'), { + position: 'asc', + }) return { taskEditTask,