mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-16 17:16:19 +00:00
feat: show session name and workspace path in heading
This commit is contained in:
@@ -29,6 +29,18 @@ const parseWorkspaceIdFromBody = (req: Request): string => {
|
||||
return workspaceId;
|
||||
};
|
||||
|
||||
const parseWorkspaceIdFromParams = (req: Request): string => {
|
||||
const workspaceId = getTrimmedString(req.params.workspaceId);
|
||||
if (!workspaceId) {
|
||||
throw new AppError('workspaceId is required.', {
|
||||
code: 'WORKSPACE_ID_REQUIRED',
|
||||
statusCode: 400,
|
||||
});
|
||||
}
|
||||
|
||||
return workspaceId;
|
||||
};
|
||||
|
||||
const parseWorkspaceCustomNameFromBody = (req: Request): string | null => {
|
||||
const body = req.body as Record<string, unknown> | undefined;
|
||||
const customName = getTrimmedString(body?.workspaceCustomName);
|
||||
@@ -43,6 +55,15 @@ router.get(
|
||||
}),
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/:workspaceId',
|
||||
asyncHandler(async (req: Request, res: Response) => {
|
||||
const workspaceId = parseWorkspaceIdFromParams(req);
|
||||
const workspace = workspaceService.getWorkspaceById(workspaceId);
|
||||
res.json(createApiSuccessResponse({ workspace }));
|
||||
}),
|
||||
);
|
||||
|
||||
router.patch(
|
||||
'/star',
|
||||
asyncHandler(async (req: Request, res: Response) => {
|
||||
|
||||
Reference in New Issue
Block a user