Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/composables/npm/useAlgoliaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export function useAlgoliaSearch() {
}
}

/** Fetch all packages for an owner using `owner.name` filter with pagination. */
async function searchByOwner(
/** Fetch all packages for a maintainer using `owners.name` filter with pagination. */
async function searchByMaintainer(
ownerName: string,
options: { maxResults?: number } = {},
): Promise<NpmSearchResponse> {
Expand All @@ -185,7 +185,7 @@ export function useAlgoliaSearch() {
query: '',
offset,
length,
filters: `owner.name:${ownerName}`,
filters: `owners.name:${ownerName}`,
analyticsTags: ['npmx.dev'],
attributesToRetrieve: ATTRIBUTES_TO_RETRIEVE,
attributesToHighlight: [],
Expand Down Expand Up @@ -286,7 +286,7 @@ export function useAlgoliaSearch() {
requests.push({
indexName,
query: '',
filters: `owner.name:${checks.name}`,
filters: `owners.name:${checks.name}`,
length: 1,
analyticsTags: ['npmx.dev'],
attributesToRetrieve: EXISTENCE_CHECK_ATTRS,
Expand Down Expand Up @@ -347,7 +347,7 @@ export function useAlgoliaSearch() {
return {
search,
searchWithSuggestions,
searchByOwner,
searchByMaintainer,
getPackagesByName,
}
}
4 changes: 2 additions & 2 deletions app/composables/npm/useUserPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useUserPackages(username: MaybeRefOrGetter<string>) {
})
// this is only used in npm path, but we need to extract it when the composable runs
const { $npmRegistry } = useNuxtApp()
const { searchByOwner } = useAlgoliaSearch()
const { searchByMaintainer } = useAlgoliaSearch()

// --- Incremental loading state (npm path) ---
const currentPage = shallowRef(1)
Expand Down Expand Up @@ -58,7 +58,7 @@ export function useUserPackages(username: MaybeRefOrGetter<string>) {
// --- Algolia: fetch all at once ---
if (provider === 'algolia') {
try {
const response = await searchByOwner(user)
const response = await searchByMaintainer(user)

// Guard against stale response (user/provider changed during await)
if (user !== toValue(username) || provider !== searchProviderValue.value) {
Expand Down
Loading