Set list in search box in settings

This commit is contained in:
Sytone 2021-06-08 08:24:11 -07:00
parent a9728f774d
commit 816c5bb4ec
5 changed files with 14 additions and 11 deletions

View File

@ -78,8 +78,8 @@ export default {
if (this.listId !== undefined) {
this.listIdForNewTask = this.listId
this.validListIdAvailable = true
} else if(this.$store.state.auth.settings.defaultListID !== undefined) {
this.listIdForNewTask = this.$store.state.auth.settings.defaultListID
} else if(this.$store.state.auth.settings.defaultListId !== undefined) {
this.listIdForNewTask = this.$store.state.auth.settings.defaultListId
this.validListIdAvailable = true
}
},

View File

@ -42,8 +42,10 @@ export default {
},
},
beforeMount() {
this.listSerivce = new ListService()
this.listService = new ListService()
this.list = new ListModel()
},
mounted() {
if (this.listId !== undefined) {
this.getListById()
}
@ -55,9 +57,10 @@ export default {
return
}
this.listSerivce.getAll({}, {s: query})
this.listService.getAll({}, {s: query})
.then(response => {
this.$set(this, 'foundLists', response)
this.$set(this, 'list', response)
})
.catch(e => {
this.error(e, this)
@ -66,7 +69,7 @@ export default {
getListById() {
this.listService.get({id: this.listId})
.then(response => {
this.$set(this, 'foundLists', response)
this.list = response
})
.catch(e => {
this.error(e, this)

View File

@ -9,7 +9,7 @@ export default class UserSettingsModel extends AbstractModel {
discoverableByName: false,
discoverableByEmail: false,
overdueTasksRemindersEnabled: true,
defaultListID: 1,
defaultListId: 1,
weekStart: 0,
}
}

View File

@ -3,9 +3,9 @@ import { ERROR_MESSAGE, LOADING } from '../mutation-types'
import UserModel from '../../models/user'
const defaultSettings = settings => {
if (typeof settings.defaultListID === 'undefined' || settings.defaultListID === '') {
settings.defaultListID = 1
}
// if (typeof settings.defaultListId === 'undefined' || settings.defaultListId === '') {
// settings.defaultListId = 1
// }
if (typeof settings.weekStart === 'undefined' || settings.weekStart === '') {
settings.weekStart = 0
}

View File

@ -138,7 +138,7 @@
Default list for new tasks is
</span>
<div class="ml-2">
<list-search @selected="changeList" :listId="settings.defaultListID" ref="defaultList"/>
<list-search @selected="changeList" :listId="settings.defaultListId" ref="defaultList"/>
</div>
</label>
</div>
@ -433,7 +433,7 @@ export default {
copy(text)
},
changeList(list) {
this.settings.defaultListID = list.id
this.settings.defaultListId = list.id
},
},
}