Skip to content

Commit

Permalink
Update additional search views API params in frontend (#3978)
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <obulat@gmail.com>
  • Loading branch information
obulat authored Mar 29, 2024
1 parent 3c00cb4 commit ab78fee
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions frontend/src/stores/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ export function computeQueryParams(
return searchQuery
}

// TODO: After the API changes are done, replace
// `tags` with `unstable__tag`
// TODO: Remove `unstable__` parameters after https://github.com/WordPress/openverse/issues/3919
export function buildCollectionQuery(
collectionParams: CollectionParams
): PaginatedCollectionQuery {
Expand All @@ -125,10 +124,10 @@ export function buildCollectionQuery(
...params,
...getSensitiveQuery("API"),
unstable__collection: collection,
collection,
}
if ("tag" in query) {
query.tags = query.tag
delete query.tag
query.unstable__tag = query.tag
}
return query
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
headers: {
connection: 'keep-alive',
},
url: '/v1/images/?creator=strogoscope&source=flickr&unstable__collection=creator',
url: '/v1/images/?creator=strogoscope&source=flickr&unstable__collection=creator&collection=creator',
method: 'GET',
body: '',
},
Expand Down Expand Up @@ -1857,4 +1857,4 @@
],
},
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
headers: {
connection: 'keep-alive',
},
url: '/v1/images/?creator=strogoscope%2F+photographer+%3F+creator&source=flickr&unstable__collection=creator',
url: '/v1/images/?creator=strogoscope%2F+photographer+%3F+creator&source=flickr&unstable__collection=creator&collection=creator',
method: 'GET',
body: '',
},
Expand Down Expand Up @@ -1857,4 +1857,4 @@
],
},
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
headers: {
connection: 'keep-alive',
},
url: '/v1/images/?source=flickr&unstable__collection=source',
url: '/v1/images/?source=flickr&unstable__collection=source&collection=source',
method: 'GET',
body: '',
},
Expand Down Expand Up @@ -1862,4 +1862,4 @@
],
},
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
headers: {
connection: 'keep-alive',
},
url: '/v1/images/?unstable__collection=tag&tags=cat',
url: '/v1/images/?unstable__collection=tag&unstable_tag=cat&collection=tag&tag=cat',
method: 'GET',
body: '',
},
Expand Down Expand Up @@ -961,4 +961,4 @@
],
},
},
}
}

0 comments on commit ab78fee

Please sign in to comment.