Revert "fix(server): use thumbnail content type instead of application/octet-stream (#3075)" (#3134)

* Revert "fix(server): use thumbnail content type instead of application/octet-stream (#3075)"

This reverts commit 3cc77d945b.

* generate api
This commit is contained in:
Alex
2023-07-06 17:25:56 -05:00
committed by GitHub
parent 852ef3cd1b
commit 812cb3d940
13 changed files with 93 additions and 41 deletions

View File

@@ -192,11 +192,19 @@ class PersonApi {
/// Parameters:
///
/// * [String] id (required):
Future<void> getPersonThumbnail(String id,) async {
Future<MultipartFile?> getPersonThumbnail(String id,) async {
final response = await getPersonThumbnailWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return null;
}
/// Performs an HTTP 'PUT /person/{id}' operation and returns the [Response].