Skip to content
Snippets Groups Projects
Commit 92f69482 authored by Bhabesh Bhabani Mukhopadhyay's avatar Bhabesh Bhabani Mukhopadhyay
Browse files

Iterating observations and routing selected one

Selected Observation routed to related components and observation id passed as parameter and accepted to Observation component as props
parent a6e341f3
Branches
No related tags found
No related merge requests found
...@@ -10,10 +10,11 @@ import { DateTime } from "luxon"; ...@@ -10,10 +10,11 @@ import { DateTime } from "luxon";
<div v-if="observations"> <div v-if="observations">
<ul class="list-group"> <ul class="list-group">
<a href="#" class="list-group-item list-group-item-action " v-for="obs in observations" > <router-link :to="{name: 'Observation', params: {observationId:obs.observationId}}" class="list-group-item list-group-item-action " v-for="obs in observations" v-bind:key="obs.observationId">
{{ obs.timeOfObservation | dateFormat }} <b>{{obs.observationHeading}}</b>
</router-link >
{{ obs.timeOfObservation | dateFormat }} <b>{{obs.observationHeading}}</b>
</a>
</ul> </ul>
</div> </div>
<div v-else class="alert alert-warning" role="alert"> <div v-else class="alert alert-warning" role="alert">
...@@ -42,7 +43,6 @@ export default { ...@@ -42,7 +43,6 @@ export default {
fetchFromServer() fetchFromServer()
{ {
let strUUID = localStorage.getItem(CommonUtil.CONST_STORAGE_UUID); let strUUID = localStorage.getItem(CommonUtil.CONST_STORAGE_UUID);
console.log(strUUID);
let jsonHeader = { Authorization: strUUID }; let jsonHeader = { Authorization: strUUID };
......
...@@ -29,7 +29,8 @@ export default new Router({ ...@@ -29,7 +29,8 @@ export default new Router({
{ {
path: '/observation', path: '/observation',
name: 'Observation', name: 'Observation',
component: Observation component: Observation,
props:true
}, },
{ {
path: '/cropCategory', path: '/cropCategory',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment