handle empty authorLocation

This commit is contained in:
fiatcode 2025-10-20 13:12:32 +07:00
parent d85653e970
commit 8686861fac

View file

@ -20,7 +20,7 @@ async function listRandomImages(count: number = 10): Promise<UnsplashImage[]> {
originUrl: buildUtmUrl(img.links.html), originUrl: buildUtmUrl(img.links.html),
authorName: img.user.name, authorName: img.user.name,
authorBio: img.user.bio ?? 'No bio', authorBio: img.user.bio ?? 'No bio',
authorLocation: img.user.location, authorLocation: img.user.location ?? 'Unknown',
authorTotalLikes: img.user.total_likes, authorTotalLikes: img.user.total_likes,
authorTotalPhotos: img.user.total_photos, authorTotalPhotos: img.user.total_photos,
authorIsForHire: img.user.for_hire, authorIsForHire: img.user.for_hire,