chore: bump version to 0.0.51 and enhance createQueryByRoutes to support dynamic queryApi export
This commit is contained in:
@@ -67,7 +67,8 @@ export const createQueryByRoutes = (list: RouteInfo[], options?: CreateQueryOpti
|
||||
obj[route.path][route.key] = route;
|
||||
}
|
||||
const before = options?.before || `import { createQueryApi } from '@kevisual/query/api';`;
|
||||
const after = options?.after || `export { queryApi };`;
|
||||
const after = options?.after || `const queryApi = createQueryApi({ api });
|
||||
export { queryApi };`;
|
||||
const code = `${before}
|
||||
const api = ${generateApiCode(obj)} as const;
|
||||
const queryApi = createQueryApi({ api });
|
||||
|
||||
Reference in New Issue
Block a user