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

@@ -10,6 +10,7 @@
getAboutInfo,
getMyUser,
getServerLicense,
isHttpError,
type LicenseResponseDto,
} from '@immich/sdk';
import Icon from '$lib/components/elements/icon.svelte';
@@ -36,7 +37,18 @@
}
if (isServerLicense && $user.isAdmin) {
serverLicenseInfo = (await getServerLicense()) as LicenseResponseDto | null;
serverLicenseInfo = await getServerLicenseInfo();
}
};
const getServerLicenseInfo = async () => {
try {
return await getServerLicense();
} catch (error) {
if (isHttpError(error) && error.status === 404) {
return null;
}
throw error;
}
};