Skip to content

Commit

Permalink
Use the correct dataset source.
Browse files Browse the repository at this point in the history
  • Loading branch information
talavis committed Nov 26, 2019
1 parent 8822dff commit bd7f41e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions frontend/vue/src/components/UserProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<th>Subscribed to email updates</th>
<th>Access</th>
</tr>
<tr v-for="row in datasets" :key="row.id">
<tr v-for="row in userDatasets" :key="row.shortName">
<td>{{row.shortName}}</td>
<td>{{row.email ? "Yes" : "No"}}</td>
<td>{{row.access ? (row.isAdmin ? "Admin" : "Approved" ) : "Request pending" }}</td>
Expand Down Expand Up @@ -120,7 +120,7 @@ export default {
error: '',
isAdmin: 0,
sftp: null,
tmp: null,
userDatasets: [],
}
},
Expand All @@ -132,20 +132,21 @@ export default {
},
computed: {
...mapGetters(['datasets', 'availableCountries', 'user'])
...mapGetters(['availableCountries', 'user'])
},
created() {
this.$store.dispatch('getCountries');
this.$store.dispatch('getDatasetList')
.then(() => {
this.datasets.forEach(function(dataset) {
this.userDatasets.forEach(function(dataset) {
this.isAdmin = this.isAdmin | dataset.isAdmin;
}, this);
});
this.affiliation = this.user.affiliation;
this.country = this.user.country;
this.getUserDatasets();
this.getSFTPCredentials();
},
Expand Down Expand Up @@ -187,6 +188,13 @@ export default {
this.sftp = response.data;
});
},
getUserDatasets () {
axios.get("/api/users/datasets")
.then((response) => {
this.userDatasets = response.data.data;
});
},
},
};
Expand Down

0 comments on commit bd7f41e

Please sign in to comment.