Skip to content

Commit 9875678

Browse files
committed
fix the api path error
1 parent e84c4a8 commit 9875678

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/factory.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,14 @@ export const apiFactory: ClubsFunctionApiFactory = (options) => {
327327
: undefined
328328

329329
const apiRoute = apiRoutes
330-
? apiRoutes.find(
331-
({ paths, method }) =>
330+
? apiRoutes.find(({ paths, method }) => {
331+
const apipath = `${plugin?.meta.id}/${paths.join('/')}`
332+
const apipathSlash = `${apipath}/`
333+
return (
332334
method === context.request.method &&
333-
path === `${plugin?.meta.id}/${paths.join('/')}`
334-
)
335+
(path === apipath || path === apipathSlash)
336+
)
337+
})
335338
: undefined
336339
const response = apiRoute
337340
? apiRoute.handler(context)

0 commit comments

Comments
 (0)