Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/example/src/app/client/ClientExample.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import { type RpcClient } from '@/app/api/v2/rpc/[operationId]/route';
import { rpcClient } from 'next-rest-framework/dist/client';
import { useEffect, useState } from 'react';
import { type Todo } from '@/utils';
import { type RpcClient } from '../(main)/api/v2/rpc/[operationId]/route';

const client = rpcClient<RpcClient>({
url: 'http://localhost:3000/api/v2/rpc'
Expand Down
3 changes: 2 additions & 1 deletion packages/next-rest-framework/src/cli/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const getRouteName = (file: string) =>
.replace('/route.js', '')
.replace(/\\/g, '/')
.replaceAll('[', '{')
.replaceAll(']', '}');
.replaceAll(']', '}')
.replace(/\/?\([^)]*\)/g, ''); // Remove route groups.

// Convert file path of an API route to an API route name.
const getApiRouteName = (file: string) =>
Expand Down