Browse Source

fixed result item link #2062

bach 1 year ago
parent
commit
15704905fb
3 changed files with 14 additions and 12 deletions
  1. 2 2
      src/components/Content/HistoryItem.vue
  2. 11 10
      src/components/Content/ResultItem.vue
  3. 1 0
      src/router/index.js

+ 2 - 2
src/components/Content/HistoryItem.vue

@@ -2,7 +2,7 @@
   <article class="result item">
     <h1>
       <a
-        :href="'/edition/'+item.id+'/'+item.textid"
+        :href="'/texts/'+item.id+'/'+item.textid"
         @click.prevent="onclick"
         @keyup.enter="onclick"
         v-html="item.title"
@@ -10,7 +10,7 @@
     </h1>
     <h2>
       <a
-        :href="'/edition/'+item.id+'/'+item.textid"
+        :href="'/texts/'+item.id+'/'+item.textid"
         @click.prevent="onclick"
         @keyup.enter="onclick"
         v-html="item.editionTitle"

+ 11 - 10
src/components/Content/ResultItem.vue

@@ -2,7 +2,7 @@
   <article class="result item">
     <h1>
       <a
-        :href="'/texts/'+result.textId+'/'+result.uuid"
+        :href="'/texts/'+result.textId+'/'+result.uuid+'/'+searchedkeys"
         @click.prevent="onclick"
         @keyup.enter="onclick"
         v-html="shorted_title"
@@ -10,7 +10,7 @@
     </h1>
     <h2>
       <a
-        :href="'/texts/'+result.textId+'/'+result.uuid"
+        :href="'/texts/'+result.textId+'/'+result.uuid+'/'+searchedkeys"
         @click.prevent="onclick"
         @keyup.enter="onclick"
         v-html="editionTitle"
@@ -78,14 +78,15 @@ export default {
         pages: this.result.pages,
         size: this.result.size
       })
-      this.$router.push({
-        name: `editiontextextract`,
-        params: {
-          id: this.result.textId,
-          textid: this.result.uuid,
-          extract: this.searchedkeys
-        }
-      })
+      // this.$router.push({
+      //   name: `editiontextextract`,
+      //   params: {
+      //     id: this.result.textId,
+      //     textid: this.result.uuid,
+      //     extract: this.searchedkeys
+      //   }
+      // })
+      this.$router.push({ path: `/texts/${this.result.textId}/${this.result.uuid}/${this.searchedkeys}` })
     }
   }
 }

+ 1 - 0
src/router/index.js

@@ -117,6 +117,7 @@ const routes = [
     component: Bibliographie,
     props: true
   },
+  // redirects /items/uuid to /texts/[edid]/[textid]
   {
     name: 'items',
     path: '/items/:uuid',