diff --git a/backend/prisma/migrations/20260316103132_add_api_keys/migration.sql b/backend/prisma/migrations/20260316103132_add_api_keys/migration.sql index c688adf..97b7610 100644 --- a/backend/prisma/migrations/20260316103132_add_api_keys/migration.sql +++ b/backend/prisma/migrations/20260316103132_add_api_keys/migration.sql @@ -1,6 +1,3 @@ --- AlterTable -ALTER TABLE "client_targets" ALTER COLUMN "working_days" DROP DEFAULT; - -- CreateTable CREATE TABLE "api_keys" ( "id" TEXT NOT NULL, diff --git a/backend/src/routes/mcp.routes.ts b/backend/src/routes/mcp.routes.ts index 6fb6447..c6d599a 100644 --- a/backend/src/routes/mcp.routes.ts +++ b/backend/src/routes/mcp.routes.ts @@ -139,15 +139,8 @@ function buildMcpServer(user: AuthenticatedUser): McpServer { clientId: z.string().uuid().optional().describe('Move project to a different client'), }, }, - async (args) => { - const { id, ...rest } = args as { - id: string; - name?: string; - description?: string; - color?: string | null; - clientId?: string; - }; - const project = await projectService.update(id, userId, rest as import('../types').UpdateProjectInput); + async ({ id, name, description, color, clientId }) => { + const project = await projectService.update(id, userId, { name, description, color, clientId }); return { content: [{ type: 'text', text: JSON.stringify(project, null, 2) }] }; } ); diff --git a/backend/src/types/index.ts b/backend/src/types/index.ts index 356274b..cd0e808 100644 --- a/backend/src/types/index.ts +++ b/backend/src/types/index.ts @@ -31,7 +31,7 @@ export interface CreateProjectInput { export interface UpdateProjectInput { name?: string; description?: string; - color?: string; + color?: string | null; clientId?: string; } diff --git a/frontend/src/pages/ApiKeysPage.tsx b/frontend/src/pages/ApiKeysPage.tsx index f1a0eb1..c1b330a 100644 --- a/frontend/src/pages/ApiKeysPage.tsx +++ b/frontend/src/pages/ApiKeysPage.tsx @@ -49,8 +49,8 @@ export function ApiKeysPage() { try { await deleteApiKey.mutateAsync(id); setRevokeConfirmId(null); - } catch (err) { - // error is surfaced inline via mutation state + } catch (_err) { + // error rendered below the table row via deleteApiKey.error } } @@ -81,6 +81,14 @@ export function ApiKeysPage() { )} + {deleteApiKey.isError && ( +
+ {deleteApiKey.error instanceof Error + ? deleteApiKey.error.message + : "Failed to revoke API key"} +
+ )} + {isLoading ? (
Loading...
) : !apiKeys || apiKeys.length === 0 ? (