install token now shown in dashboard until install completes.
This commit is contained in:
18 files changed
+1977
-15
No files matched your search
@@ -12,6 +12,8 @@ export const INSTALLATION_SINGLETON_ID = "singleton";
|
||||
export interface InstallationState {
|
||||
installed: boolean;
|
||||
status: InstallationStatus;
|
||||
/** When `status === INSTALLED`, else null. Surfaced by GET /api/health so an external tool (e.g. NextChair Manager) can show it without ever needing DB access of its own — see that route's own header. */
|
||||
installedAt: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,10 +27,10 @@ export interface InstallationState {
|
||||
export const getInstallationState = cache(async (): Promise<InstallationState> => {
|
||||
const row = await prisma.applicationInstallation.findUnique({
|
||||
where: { id: INSTALLATION_SINGLETON_ID },
|
||||
select: { status: true },
|
||||
select: { status: true, installedAt: true },
|
||||
});
|
||||
const status = row?.status ?? InstallationStatus.NOT_INSTALLED;
|
||||
return { installed: status === InstallationStatus.INSTALLED, status };
|
||||
return { installed: status === InstallationStatus.INSTALLED, status, installedAt: row?.installedAt ?? null };
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user