Skip to content

Commit 5efdff9

Browse files
authored
fix: use owners.name facet for user profile pkgs (#2513)
1 parent ef819d1 commit 5efdff9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/composables/npm/useAlgoliaSearch.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ export function useAlgoliaSearch() {
161161
}
162162
}
163163

164-
/** Fetch all packages for an owner using `owner.name` filter with pagination. */
165-
async function searchByOwner(
164+
/** Fetch all packages for a maintainer using `owners.name` filter with pagination. */
165+
async function searchByMaintainer(
166166
ownerName: string,
167167
options: { maxResults?: number } = {},
168168
): Promise<NpmSearchResponse> {
@@ -185,7 +185,7 @@ export function useAlgoliaSearch() {
185185
query: '',
186186
offset,
187187
length,
188-
filters: `owner.name:${ownerName}`,
188+
filters: `owners.name:${ownerName}`,
189189
analyticsTags: ['npmx.dev'],
190190
attributesToRetrieve: ATTRIBUTES_TO_RETRIEVE,
191191
attributesToHighlight: [],
@@ -286,7 +286,7 @@ export function useAlgoliaSearch() {
286286
requests.push({
287287
indexName,
288288
query: '',
289-
filters: `owner.name:${checks.name}`,
289+
filters: `owners.name:${checks.name}`,
290290
length: 1,
291291
analyticsTags: ['npmx.dev'],
292292
attributesToRetrieve: EXISTENCE_CHECK_ATTRS,
@@ -347,7 +347,7 @@ export function useAlgoliaSearch() {
347347
return {
348348
search,
349349
searchWithSuggestions,
350-
searchByOwner,
350+
searchByMaintainer,
351351
getPackagesByName,
352352
}
353353
}

app/composables/npm/useUserPackages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function useUserPackages(username: MaybeRefOrGetter<string>) {
2828
})
2929
// this is only used in npm path, but we need to extract it when the composable runs
3030
const { $npmRegistry } = useNuxtApp()
31-
const { searchByOwner } = useAlgoliaSearch()
31+
const { searchByMaintainer } = useAlgoliaSearch()
3232

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

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

0 commit comments

Comments
 (0)