Browse Source

Filter studies on being acive

master
Joshua Rubingh 4 months ago
parent
commit
7893e1e95a
  1. 5
      pages/researchStudies/index.vue
  2. 3
      store/studies.js

5
pages/researchStudies/index.vue

@ -10,9 +10,12 @@ export default { @@ -10,9 +10,12 @@ export default {
async asyncData({ store }) {
await store.dispatch('studies/getStudies')
await store.dispatch('studies/getStudyFields')
const me = store.getters['authorisation/getUser']
return {
studies: store.getters['studies/getStudies'],
// TODO: This is due to the invite page.... So here we filter out all studies were we are not active
studies: store.getters['studies/getStudies'].filter(study => {return study.contributors.filter(contributor => {return contributor.researcher.id === me.id && contributor.active}).length > 0}),
studyFields: store.getters['studies/getStudyFields'],
me: store.getters['authorisation/getUser']
}
},
head() {

3
store/studies.js

@ -99,7 +99,8 @@ export const mutations = { @@ -99,7 +99,8 @@ export const mutations = {
name: study.name,
field: study.field,
startDate: new Date(study.created_at),
amountContributors: study.contributors.length
amountContributors: study.contributors.length,
contributors: study.contributors
}
})
},

Loading…
Cancel
Save