@@ -6,31 +6,31 @@ import { getIconSvgsForSet } from '../../../../utils/icons/reactIcons'
66/**
77 * Prerender at build time so this doesn't run in the Cloudflare Worker.
88 * getIconSvgsForSet() reads from @patternfly/react-icons/dist/static (Node fs).
9- * Serves JSON of all icon SVGs for a set (e.g. /api/v5 /icons/pf.json ).
9+ * Serves JSON of all icon SVGs for a set (e.g. /api/v6 /icons/pf).
1010 */
1111export const prerender = true
1212
1313export const getStaticPaths : GetStaticPaths = async ( ) => {
1414 const versions = await getVersionsFromIndexFile ( )
1515 return versions . flatMap ( ( version ) => [
16- { params : { version, setId : 'pf' } } ,
16+ { params : { version, iconSet : 'pf' } } ,
1717 ] )
1818}
1919
2020export const GET : APIRoute = async ( { params } ) => {
21- const { version, setId } = params
21+ const { version, iconSet } = params
2222 if ( ! version ) {
2323 return createJsonResponse (
2424 { error : 'Version parameter is required' } ,
2525 400 ,
2626 )
2727 }
28- if ( ! setId ) {
29- return createJsonResponse ( { error : 'Set ID is required' } , 400 )
28+ if ( ! iconSet ) {
29+ return createJsonResponse ( { error : 'Icon set is required' } , 400 )
3030 }
3131
3232 try {
33- const svgs = await getIconSvgsForSet ( setId )
33+ const svgs = await getIconSvgsForSet ( iconSet )
3434 return createJsonResponse ( svgs )
3535 } catch ( error ) {
3636 const details = error instanceof Error ? error . message : String ( error )
0 commit comments