updatePrefs method

Future<Preferences> updatePrefs({
  1. required String teamId,
  2. required Map prefs,
})

Update preferences

Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.

Implementation

Future<models.Preferences> updatePrefs(
    {required String teamId, required Map prefs}) async {
  final String apiPath =
      '/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);

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

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

  final res = await client.call(HttpMethod.put,
      path: apiPath, params: apiParams, headers: apiHeaders);

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