Update src/app/api/events/route.ts
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
This commit is contained in:
parent
ec3bfa03ef
commit
8def5ae1a3
1 changed files with 14 additions and 1 deletions
|
|
@ -7,7 +7,20 @@ const HEARTBEAT_MS = 15_000;
|
||||||
|
|
||||||
export async function GET(request: Request): Promise<Response> {
|
export async function GET(request: Request): Promise<Response> {
|
||||||
const url = new URL(request.url);
|
const url = new URL(request.url);
|
||||||
const projectRoot = canonicalizeWindowsPath(url.searchParams.get('projectRoot') ?? process.cwd());
|
const projectRootSearchParam = url.searchParams.get('projectRoot');
|
||||||
|
if (!projectRootSearchParam) {
|
||||||
|
return Response.json(
|
||||||
|
{
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
classification: 'bad_args',
|
||||||
|
message: 'The `projectRoot` query parameter is required.',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ status: 400 },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const projectRoot = canonicalizeWindowsPath(projectRootSearchParam);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getIssuesWatchManager().startWatch(projectRoot);
|
getIssuesWatchManager().startWatch(projectRoot);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue