1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-06 06:07:29 +02:00

fix(server): correct openapi response type for getServerLicense() (#11261)

* fix(server): correct openapi response type for getServerLicense()

* return 404 error when license doesn't exist

* update e2e test
This commit is contained in:
Michel Heusschen
2024-07-22 15:50:45 +02:00
committed by GitHub
parent 3d7a9d79da
commit 849bc6e3aa
7 changed files with 36 additions and 14 deletions

View File

@ -75,7 +75,7 @@ class ServerApi {
);
}
Future<Object?> getServerLicense() async {
Future<LicenseResponseDto?> getServerLicense() async {
final response = await getServerLicenseWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
@ -84,7 +84,7 @@ class ServerApi {
// 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), 'LicenseResponseDto',) as LicenseResponseDto;
}
return null;