Skip to content

Commit 2859f12

Browse files
mxmzbclaude
andcommitted
fix(saas-demo): minor reference-demo cleanups
- cards PUT handler: stop console.info'ing the request body, which included the plaintext PIN on every PIN-change request. - wrapper.tsx: drop the duplicate ./globals.css import (already imported in app/layout.tsx, which is the canonical place). - copilot-context.tsx: replace window.location.pathname read during render with usePathname() from next/navigation, matching how components/layout.tsx already derives the current route. - next.config.mjs: remove the eslint.ignoreDuringBuilds block — Next 16 no longer runs ESLint at build, and the key now produces an "Unrecognized key(s): 'eslint'" warning. Confirmed warning is gone. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0a70125 commit 2859f12

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
3-
eslint: {
4-
ignoreDuringBuilds: true,
5-
},
6-
};
2+
const nextConfig = {};
73

84
export default nextConfig;

examples/showcases/banking/src/app/api/v1/cards/[id]/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ export const PUT = async (
99
const { id: cardId } = await params;
1010
// Handle pin or card limit change
1111
const body = await req.json();
12-
console.info(
13-
`${req.method}: ${req.url} called with: ${JSON.stringify(body)}`,
14-
);
1512
const { pin } = body;
1613
if (!pin) {
1714
const card = store.findCard(cardId);

examples/showcases/banking/src/app/wrapper.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22
import { LayoutComponent } from "@/components/layout";
3-
import "./globals.css";
43
import {
54
CopilotKitProvider,
65
CopilotPopup,

examples/showcases/banking/src/components/copilot-context.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22
import { useAgentContext, useHumanInTheLoop } from "@copilotkit/react-core/v2";
3+
import { usePathname } from "next/navigation";
34
import { z } from "zod";
45
import { useAuthContext } from "@/components/auth-context";
56
import { Button } from "./ui/button";
@@ -27,6 +28,7 @@ export const AVAILABLE_OPERATIONS_PER_PAGE = {
2728
// A component dedicated to adding readables/actions that are global to the app.
2829
const CopilotContext = ({ children }: { children: React.ReactNode }) => {
2930
const { currentUser } = useAuthContext();
31+
const pathname = usePathname();
3032

3133
// A readable of app wide authentication and authorization context.
3234
// The LLM will now know which user is it working against, when performing operations.
@@ -42,7 +44,7 @@ const CopilotContext = ({ children }: { children: React.ReactNode }) => {
4244
value: {
4345
pages: Object.values(Page),
4446
operations: AVAILABLE_OPERATIONS_PER_PAGE,
45-
currentPage: window.location.pathname.split("/").pop() as Page,
47+
currentPage: pathname.split("/").pop() as Page,
4648
},
4749
});
4850

0 commit comments

Comments
 (0)