summaryrefslogtreecommitdiffstats
path: root/app/preference.go
blob: 4e492c4a82bedfde9b283cdc13703091b311a907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package app

import (
	"github.com/mattermost/platform/model"
)

func GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) {
	if result := <-Srv.Store.Preference().GetAll(userId); result.Err != nil {
		return nil, result.Err
	} else {
		return result.Data.(model.Preferences), nil
	}
}