add reading settings sync
This commit is contained in:
@@ -59,6 +59,20 @@ func (s *UserService) UpdateProfile(ctx context.Context, id string, name, avatar
|
||||
return s.users.UpdateProfile(ctx, id, name, avatarURL, handle)
|
||||
}
|
||||
|
||||
// GetReadingPrefs returns the user's reading prefs blob (opaque JSON).
|
||||
// Used by the frontend to hydrate ReadingSettings on sign-in so the
|
||||
// theme/palette/font choices roam across devices.
|
||||
func (s *UserService) GetReadingPrefs(ctx context.Context, id string) ([]byte, error) {
|
||||
return s.users.GetReadingPrefs(ctx, id)
|
||||
}
|
||||
|
||||
// UpdateReadingPrefs overwrites the user's reading prefs blob. The
|
||||
// handler re-marshals the decoded request before calling in here so we
|
||||
// know `prefsJSON` is well-formed by the time it hits the DB.
|
||||
func (s *UserService) UpdateReadingPrefs(ctx context.Context, id string, prefsJSON []byte) error {
|
||||
return s.users.UpdateReadingPrefs(ctx, id, prefsJSON)
|
||||
}
|
||||
|
||||
// normalizeHandle lowercases and strips anything that isn't [a-z0-9-]. Same
|
||||
// rules as slugForHandle in auth_service, but exposed here because the
|
||||
// profile-update path doesn't go through auth.
|
||||
|
||||
Reference in New Issue
Block a user