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

add redirect for legacy path #241

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions pages/datasets/segmentationviewer/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script>
// Need to re-direct from the old path of /datasets/segmentationviewer?dataset_id={dataset_id}&dataset_version={dataset_version}&file_path={file_path} to the corresponding file with that viewer:
// Example: https://sparc.science/datasets/segmentationviewer?dataset_id=60&dataset_version=4&file_path=files/derivative/sub-22/sam-1/sub-22_sam-1_R22-1MergeMask+(1).xml now maps to
// https://sparc.science/datasets/file/60/4?path=files/derivative/sub-22/sam-1/sub-22_sam-1_R22-1MergeMask+(1).xml
export default {
name: 'SegmentationViewerPage',

async setup() {
const router = useRouter()
const route = useRoute()
const datasetId = route.query.dataset_id
const versionId = route.query.dataset_version
const filePath = route.query.file_path
const newPath = `/datasets/file/${datasetId}/${versionId}`

router.replace({ path: newPath, query: {'path': filePath}})
}
}
</script>
Loading