Prefs managing mostly done
This commit is contained in:
parent
81d02b82dc
commit
74851b9c4d
6 changed files with 344 additions and 51 deletions
|
|
@ -55,3 +55,9 @@ func (u UserSession) Preferences() (prefs map[string]UserPreferences, err error)
|
|||
err = json.Unmarshal(data, &prefs)
|
||||
return
|
||||
}
|
||||
|
||||
func (u UserSession) SetPreferences(prefs map[string]UserPreferences) (err error) {
|
||||
j, _ := json.Marshal(prefs)
|
||||
_, err = u.Db.Exec(`UPDATE public.user SET preferences=$2 WHERE id=$1`, u.UserID, j)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue