Change activeUsers field type to []string (#3909)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
parent
e075f408d3
commit
35f681dd75
2 changed files with 6 additions and 3 deletions
|
@ -34,7 +34,7 @@ type BoardInsight struct {
|
|||
|
||||
// IDs of users active on the board
|
||||
// required: true
|
||||
ActiveUsers string `json:"activeUsers"`
|
||||
ActiveUsers mmModel.StringArray `json:"activeUsers"`
|
||||
|
||||
// ID of user who created the board
|
||||
// required: true
|
||||
|
|
|
@ -3,6 +3,7 @@ package sqlstore
|
|||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/focalboard/server/model"
|
||||
|
@ -129,15 +130,17 @@ func boardsInsightsFromRows(rows *sql.Rows) ([]*model.BoardInsight, error) {
|
|||
boardsInsights := []*model.BoardInsight{}
|
||||
for rows.Next() {
|
||||
var boardInsight model.BoardInsight
|
||||
|
||||
var activeUsersString string
|
||||
err := rows.Scan(
|
||||
&boardInsight.BoardID,
|
||||
&boardInsight.Title,
|
||||
&boardInsight.Icon,
|
||||
&boardInsight.ActivityCount,
|
||||
&boardInsight.ActiveUsers,
|
||||
&activeUsersString,
|
||||
&boardInsight.CreatedBy,
|
||||
)
|
||||
// split activeUsersString into slice
|
||||
boardInsight.ActiveUsers = strings.Split(activeUsersString, ",")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue