Installation
CI / ci (push) Canceled after 0s

install token now shown in dashboard until install completes.
This commit is contained in:
Stefan Lazic committed 2026-09-06 20:14:25 +01:00
1 parent d7a8b15482
commit e9e28a243f
18 files changed
+1977 -15

No files matched your search

+4 -2
View File
@@ -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 };
});
/**