focalboard/server/app/user.go
Jesús Espino 46fdbf9048
Initial Boards+Channels implementation (#3110)
* Initial Boards+Channels implementation

* Adding draft code to list the boards in a channel

* Adding the hability to link/unlink channels (fake channel for now)

* Simplify slight the migrations

* WIP

* More changes to improve the implementation

* Adding partial implementation of linking channel from board

* Allow linking in both directions

* Removing unused file

* More work on channel binding

* some refactoring

* Improving code quality and interface

* More improvements

* Changing the API to search channels

* Adding a limit of 10 channels in search

* Add confirmation on linking public channels

* Improve a bit the styling of the confirmation modal

* Showing the current linked channel

* Adding link board confirmation to channel interface

* Fixing tests and linter errors

* Fixing backend tests

* Adding permissions tests

* Fixing linter errors

* Fixing small things

* Fixing some typescript errors

* Adding new boardSelectorItem tests

* Improving a bit tests

* Adding jest unit tests

* Remove duplicated implementation (from merge, I guess)

* Adding missed files

* Addressing some of the PR review comments

* Removing unneeded new wrapIntl implementation

* Moving NotSupportedError to the store package to be share between all the store implementations or layers

* Fixing one of the pendings ToDo

* Creating a constructor for the NotSupportedError

* Fixing linter error
2022-07-07 16:46:53 +02:00

35 lines
993 B
Go

package app
import (
"github.com/mattermost/focalboard/server/model"
mmModel "github.com/mattermost/mattermost-server/v6/model"
)
func (a *App) GetTeamUsers(teamID string) ([]*model.User, error) {
return a.store.GetUsersByTeam(teamID)
}
func (a *App) SearchTeamUsers(teamID string, searchQuery string) ([]*model.User, error) {
return a.store.SearchUsersByTeam(teamID, searchQuery)
}
func (a *App) UpdateUserConfig(userID string, patch model.UserPropPatch) (map[string]interface{}, error) {
if err := a.store.PatchUserProps(userID, patch); err != nil {
return nil, err
}
user, err := a.store.GetUserByID(userID)
if err != nil {
return nil, err
}
return user.Props, nil
}
func (a *App) SearchUserChannels(teamID string, userID string, query string) ([]*mmModel.Channel, error) {
return a.store.SearchUserChannels(teamID, userID, query)
}
func (a *App) GetChannel(teamID string, channelID string) (*mmModel.Channel, error) {
return a.store.GetChannel(teamID, channelID)
}