@@ -7,10 +7,13 @@ import * as app from '#shared/types/lexicons/app'
77
88export default defineCachedEventHandler (
99 async event => {
10+ console . log ( 'bluesky author profiles 1' )
1011 const query = getQuery ( event )
1112 const authorsParam = query . authors
13+ console . log ( 'bluesky author profiles 2' , authorsParam )
1214
1315 if ( ! authorsParam || typeof authorsParam !== 'string' ) {
16+ console . log ( 'bluesky author profiles 3' )
1417 throw createError ( {
1518 statusCode : 400 ,
1619 statusMessage : 'authors query parameter is required (JSON array)' ,
@@ -22,6 +25,7 @@ export default defineCachedEventHandler(
2225 const parsed = JSON . parse ( authorsParam )
2326 authors = v . parse ( v . array ( AuthorSchema ) , parsed )
2427 } catch ( error ) {
28+ console . log ( 'bluesky author profiles 4' , error )
2529 if ( error instanceof v . ValiError ) {
2630 throw createError ( {
2731 statusCode : 400 ,
@@ -33,12 +37,14 @@ export default defineCachedEventHandler(
3337 statusMessage : 'authors must be valid JSON' ,
3438 } )
3539 }
40+ console . log ( 'bluesky author profiles 5' , authors )
3641
3742 if ( ! Array . isArray ( authors ) || authors . length === 0 ) {
3843 return { authors : [ ] }
3944 }
4045
4146 const handles = authors . map ( a => a . blueskyHandle ) . filter ( v => v != null )
47+ console . log ( 'bluesky author profiles 6' , handles )
4248
4349 if ( handles . length === 0 ) {
4450 return {
@@ -67,6 +73,7 @@ export default defineCachedEventHandler(
6773 : null ,
6874 } ) ,
6975 )
76+ console . log ( 'bluesky author profiles 7' , resolvedAuthors )
7077
7178 return { authors : resolvedAuthors }
7279 } ,
0 commit comments