fix: task sorting by position in list view
Resolves https://kolaente.dev/vikunja/frontend/issues/2119
This commit is contained in:
parent
4a8b7a726a
commit
99a5afc817
2 changed files with 6 additions and 5 deletions
|
@ -20,14 +20,13 @@ const SORT_BY_DEFAULT = {
|
||||||
/**
|
/**
|
||||||
* This mixin provides a base set of methods and properties to get tasks on a list.
|
* 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 params = ref({...getDefaultParams()})
|
||||||
|
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
const page = ref(1)
|
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.
|
// 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
|
// When tasks would be sorted first by id and then by whatever else was specified, the id sort takes
|
||||||
|
|
|
@ -214,7 +214,9 @@ export default defineComponent({
|
||||||
// isTaskEdit.value = false
|
// isTaskEdit.value = false
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const taskList = useTaskList(toRef(props, 'listId'))
|
const taskList = useTaskList(toRef(props, 'listId'), {
|
||||||
|
position: 'asc',
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
taskEditTask,
|
taskEditTask,
|
||||||
|
|
Loading…
Add table
Reference in a new issue