Skip to content

Commit 3078e12

Browse files
authored
fix: wrong endpoint requested in generated SWR hooks (#503)
1 parent e9de1cc commit 3078e12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/plugins/swr/src/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ function generateQueryHook(
295295
.addBody()
296296
.addStatements([
297297
'const { endpoint } = useContext(RequestHandlerContext);',
298-
`return request.get<${returnType}>(\`\${endpoint}/${modelRouteName}/findMany\`, args, options);`,
298+
`return request.get<${returnType}>(\`\${endpoint}/${modelRouteName}/${operation}\`, args, options);`,
299299
]);
300300
}
301301

0 commit comments

Comments
 (0)