From 129b5a75b28b28d43f1df09e479dba2ff28a2471 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Sat, 23 May 2020 11:09:13 -0700 Subject: [PATCH] Uses == and fixes error messages --- assets/pages/Show.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/pages/Show.vue b/assets/pages/Show.vue index 41d38504..c3249b6c 100644 --- a/assets/pages/Show.vue +++ b/assets/pages/Show.vue @@ -10,8 +10,13 @@ export default { visibleContainers(newValue) { if (newValue) { if (this.$route.query.name) { - const [container, _] = this.visibleContainers.filter((c) => c.name.includes(this.$route.query.name)); - this.$router.push({ name: "container", params: { id: container.id } }); + const [container, _] = this.visibleContainers.filter((c) => c.name == this.$route.query.name); + if (container) { + this.$router.push({ name: "container", params: { id: container.id } }); + } else { + console.error(`No containers found matching name=${this.$route.query.name}. Redirecting to /`); + this.$router.push({ name: "default" }); + } } else { console.error(`Expection query parameter name to be set. Redirecting to /`); this.$router.push({ name: "default" });