A social knowledge tool for researchers built on ATProto

refactor: handle callingUserId consistently in GetSimilarUrlsForUrlUseCase

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

Changed files
+7 -7
src
modules
search
application
domain
services
+1 -1
src/modules/search/application/useCases/queries/GetSimilarUrlsForUrlUseCase.ts
··· 23 thumbnailUrl?: string; 24 }; 25 urlLibraryCount: number; 26 - urlInLibrary?: boolean; 27 } 28 29 export interface GetSimilarUrlsForUrlResult {
··· 23 thumbnailUrl?: string; 24 }; 25 urlLibraryCount: number; 26 + urlInLibrary: boolean; 27 } 28 29 export interface GetSimilarUrlsForUrlResult {
+6 -6
src/modules/search/domain/services/SearchService.ts
··· 137 const urlLibraryCount = librariesResult.totalCount; 138 139 // Check if calling user has this URL in their library 140 - let urlInLibrary = false; 141 - if (callingUserId) { 142 - urlInLibrary = librariesResult.items.some( 143 - (library) => library.userId === callingUserId, 144 - ); 145 - } 146 147 return { 148 url: result.url,
··· 137 const urlLibraryCount = librariesResult.totalCount; 138 139 // Check if calling user has this URL in their library 140 + // Default to false if no calling user (unauthenticated request) 141 + const urlInLibrary = callingUserId 142 + ? librariesResult.items.some( 143 + (library) => library.userId === callingUserId, 144 + ) 145 + : false; 146 147 return { 148 url: result.url,