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

fix: APPS-2903 Create a redirect for staff subject librarian #862

Merged
15 changes: 15 additions & 0 deletions middleware/redirect.global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default defineNuxtRouteMiddleware((to) => {
const filters = to.query.filters

// Check if the filters parameter matches the condition
if (filters && filters === '{"subjectLibrarian.keyword":"yes"}') {
// Modify the query parameter
const newFilters = 'subjectLibrarian.keyword:(yes)'

// Construct the new query object
const newQuery = { ...to.query, filters: newFilters }

// Redirect to the new URL with updated query parameters
return navigateTo({ path: to.path, query: newQuery })
}
})
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[[edge_functions]]
path = "/*"
function = "blockUserAgents"
function = "blockUserAgents"
Loading