Add default list setting #875
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sytone/api:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add the setting to the API for a default list.
I have never coded in go before so went with the flow. 😄
Checklist
mage do-the-swag
)config.yml.saml
and runningmage generate-docs
)Thanks for the PR! Please see the comments below.
It looks like the CI fail is related to swagger docs not being up to date. Could you regenerate them? (You already seem to have done that, not sure why the CI fails nontheless. It should work with a regeneration though)
@ -0,0 +22,4 @@
)
type users20210527105701 struct {
DefaultListForNewTasks int `xorm:"int default 1 index" json:"-"`
A few things:
int64
as all other ids are. Same for the xorm tag (I think that is bigint, take a look at the other ID fields).DefaultListID
- that way it's clear what this is.Updated and renames, tests updated.
@ -47,1 +47,4 @@
OverdueTasksRemindersEnabled bool `json:"overdue_tasks_reminders_enabled"`
// If a task is created without a specified list this value should be used. Applies
// to tasks made directly in API and from clients.
DefaultListForNewTasks int `json:"default_list_for_new_tasks"`
Should be
int64
as well.Updated to match.
@ -71,6 +71,7 @@ type User struct {
DiscoverableByName bool `xorm:"bool default false index" json:"-"`
DiscoverableByEmail bool `xorm:"bool default false index" json:"-"`
OverdueTasksRemindersEnabled bool `xorm:"bool default true index" json:"-"`
DefaultListForNewTasks int `xorm:"int default 1 index" json:"-"`
Please see the comments on the migration.
Updated to match migraiton, now null by default, bigint which maps to int64 as verified in the xorm documents.
Updated the code to reflect comments. Was out on vacation and also had to reset my WSL environment, took a bit as I had not used go before but worked my way through it.
Looks good, thanks!