Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update additional search views API params in frontend #3978

Merged
merged 1 commit into from
Mar 29, 2024
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
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 @@
],
},
},
}
}
Loading