1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-17 03:47:45 +02:00

refactor(server): immich file responses (#5641)

* refactor(server): immich file response

* chore: open api

* chore: tests

* chore: fix logger import

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen
2023-12-12 09:58:25 -05:00
committed by GitHub
parent af7c4ae090
commit cbca69841a
25 changed files with 186 additions and 154 deletions

View File

@ -327,7 +327,7 @@ class UserApi {
/// Parameters:
///
/// * [String] id (required):
Future<Object?> getProfileImage(String id,) async {
Future<MultipartFile?> getProfileImage(String id,) async {
final response = await getProfileImageWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
@ -336,7 +336,7 @@ class UserApi {
// 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), 'Object',) as Object;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return null;