updatePrefs method

Future<Account> updatePrefs({
  1. required Map prefs,
})

Update Preferences

Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.

Implementation

Future<models.Account> updatePrefs({required Map prefs}) async {
  const String path = '/account/prefs';

  final Map<String, dynamic> params = {
    'prefs': prefs,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.patch,
      path: path, params: params, headers: headers);

  return models.Account.fromMap(res.data);
}