···5import { URL } from '../../../../cards/domain/value-objects/URL';
6import { SearchService } from '../../../domain/services/SearchService';
7import { GetSimilarUrlsForUrlParams } from '@semble/types/api/requests';
8-import { GetSimilarUrlsForUrlResponse, UrlView } from '@semble/types/api/responses';
0009import { Pagination } from '@semble/types/api/common';
1011export interface GetSimilarUrlsForUrlQuery extends GetSimilarUrlsForUrlParams {
···5import { URL } from '../../../../cards/domain/value-objects/URL';
6import { SearchService } from '../../../domain/services/SearchService';
7import { GetSimilarUrlsForUrlParams } from '@semble/types/api/requests';
8+import {
9+ GetSimilarUrlsForUrlResponse,
10+ UrlView,
11+} from '@semble/types/api/responses';
12import { Pagination } from '@semble/types/api/common';
1314export interface GetSimilarUrlsForUrlQuery extends GetSimilarUrlsForUrlParams {
+3-1
src/modules/search/domain/IVectorDatabase.ts
···33 /**
34 * Find URLs similar to the given URL
35 */
36- findSimilarUrls(params: FindSimilarUrlsParams): Promise<Result<UrlSearchResult[]>>;
003738 /**
39 * Remove a URL from the search index
···33 /**
34 * Find URLs similar to the given URL
35 */
36+ findSimilarUrls(
37+ params: FindSimilarUrlsParams,
38+ ): Promise<Result<UrlSearchResult[]>>;
3940 /**
41 * Remove a URL from the search index
···124 const enrichedResults = await Promise.all(
125 searchResults.map(async (result) => {
126 // Get library information for this URL
127- const librariesResult = await this.cardQueryRepository.getLibrariesForUrl(
128- result.url,
129- {
130 page: 1,
131 limit: 1000, // Get all libraries to count them
132 sortBy: 'createdAt' as any, // Type assertion needed due to enum mismatch
133 sortOrder: 'desc' as any,
134- },
135- );
136137 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
···124 const enrichedResults = await Promise.all(
125 searchResults.map(async (result) => {
126 // Get library information for this URL
127+ const librariesResult =
128+ await this.cardQueryRepository.getLibrariesForUrl(result.url, {
0129 page: 1,
130 limit: 1000, // Get all libraries to count them
131 sortBy: 'createdAt' as any, // Type assertion needed due to enum mismatch
132 sortOrder: 'desc' as any,
133+ });
0134135 const urlLibraryCount = librariesResult.totalCount;
136+137 // Check if calling user has this URL in their library
138 // Default to false if no calling user (unauthenticated request)
139 const urlInLibrary = callingUserId