Prefs managing mostly done

This commit is contained in:
Magnus Åhall 2026-06-21 10:59:38 +02:00
parent 81d02b82dc
commit 74851b9c4d
6 changed files with 344 additions and 51 deletions

View file

@ -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
}