11import { z } from 'zod'
2+ import { queryCollection } from '@nuxt/content/server'
23
34const querySchema = z . object ( {
45 category : z . string ( ) . optional ( ) . describe ( 'Filter components by category' ) ,
@@ -8,11 +9,9 @@ const querySchema = z.object({
89export default defineCachedEventHandler ( async ( event ) => {
910 const { category, search } = await getValidatedQuery ( event , querySchema . parse )
1011
11- // @ts -expect-error TODO: This will be fixed when the tsconfig is setup correctly
1212 let query = queryCollection ( event , 'docs' )
1313 . where ( 'path' , 'LIKE' , '/docs/components/%' )
1414 . where ( 'extension' , '=' , 'md' )
15- // @ts -expect-error TODO: This will be fixed when the tsconfig is setup correctly
1615 . select ( 'id' , 'title' , 'description' , 'path' , 'category' , 'links' )
1716
1817 if ( category ) {
@@ -25,11 +24,9 @@ export default defineCachedEventHandler(async (event) => {
2524 name : component . path . split ( '/' ) . pop ( ) ,
2625 title : component . title ,
2726 description : component . description ,
28- // @ts -expect-error TODO: This will be fixed when the tsconfig is setup correctly
2927 category : component . category ,
3028 path : component . path ,
3129 url : `https://ui.nuxt.com${ component . path } ` ,
32- // @ts -expect-error TODO: This will be fixed when the tsconfig is setup correctly
3330 links : component . links
3431 } ) )
3532
0 commit comments