mirror of
https://github.com/immich-app/immich.git
synced 2025-11-28 13:59:45 +09: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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user