From 9cbac6155232dd7b678467005ea120570571c0ef Mon Sep 17 00:00:00 2001 From: Ben Reinhart Date: Fri, 26 Jul 2024 12:38:53 -0700 Subject: [PATCH] Use session id on client and remove client dir --- packages/api/session.mts | 4 ---- packages/web/src/components/delete-srcbook-dialog.tsx | 2 +- packages/web/src/types.ts | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/api/session.mts b/packages/api/session.mts index 24be75f6..7fdcf7ed 100644 --- a/packages/api/session.mts +++ b/packages/api/session.mts @@ -291,8 +291,6 @@ export function sessionToResponse(session: SessionType) { id: session.id, cells: session.cells, metadata: session.metadata, - // Only pass the dir ID to the client, making it easier to use it as an identifier in urls - dir: Path.basename(session.dir), 'tsconfig.json': session['tsconfig.json'], openedAt: session.openedAt, }; @@ -301,8 +299,6 @@ export function sessionToResponse(session: SessionType) { id: session.id, cells: session.cells, metadata: session.metadata, - // Only pass the dir ID to the client, making it easier to use it as an identifier in urls - dir: Path.basename(session.dir), openedAt: session.openedAt, }; } diff --git a/packages/web/src/components/delete-srcbook-dialog.tsx b/packages/web/src/components/delete-srcbook-dialog.tsx index 04b427b3..78a5f538 100644 --- a/packages/web/src/components/delete-srcbook-dialog.tsx +++ b/packages/web/src/components/delete-srcbook-dialog.tsx @@ -26,7 +26,7 @@ export default function DeleteSrcbookModal({ if (!session) return; const onConfirmDelete = async () => { - deleteSrcbook({ id: session.dir }) + deleteSrcbook({ id: session.id }) .then(() => { onOpenChange(false); navigate('/', { replace: true }); diff --git a/packages/web/src/types.ts b/packages/web/src/types.ts index 51a405b5..993cab3a 100644 --- a/packages/web/src/types.ts +++ b/packages/web/src/types.ts @@ -25,7 +25,6 @@ export type OutputType = StdoutOutputType | StderrOutputType; export type SessionType = { id: string; - dir: string; cells: CellType[]; metadata: SrcbookMetadataType; // TODO: Better typing.