Kanban #393

Merged
konrad merged 14 commits from feature/kanban into master 2020-04-19 07:27:29 +00:00
1 changed files with 19 additions and 5 deletions
Showing only changes of commit de20a17455 - Show all commits

View File

@ -74,11 +74,12 @@ func (b *Bucket) ReadAll(auth web.Auth, search string, page int, perPage int) (r
buckets := []*Bucket{
{
// This is the default bucket for all tasks which are not associated to a bucket.
ID: 0,
Title: "Not associated to a bucket",
ListID: b.ListID,
Created: timeutil.FromTime(time.Now()),
Updated: timeutil.FromTime(time.Now()),
ID: 0,
Title: "Not associated to a bucket",
ListID: b.ListID,
Created: timeutil.FromTime(time.Now()),
Updated: timeutil.FromTime(time.Now()),
CreatedByID: auth.GetID(),
},
}
@ -94,8 +95,21 @@ func (b *Bucket) ReadAll(auth web.Auth, search string, page int, perPage int) (r
// Make a map from the bucket slice with their id as key so that we can use it to put the tasks in their buckets
bucketMap := make(map[int64]*Bucket, len(buckets))
userIDs := make([]int64, 0, len(buckets))
for _, bb := range buckets {
bucketMap[bb.ID] = bb
userIDs = append(userIDs, bb.CreatedByID)
}
// Get all users
users := make(map[int64]*user.User)
err = x.In("id", userIDs).Find(&users)
if err != nil {
return
}
for _, bb := range buckets {
bb.CreatedBy = users[bb.CreatedByID]
}
// Get all tasks for this list