My Challenges should include all Owned Challenges (#9286)

This commit is contained in:
Marvin Rabe
2018-05-07 16:23:49 +02:00
parent 0d84643961
commit 5f319ca4f6

View File

@@ -63,8 +63,6 @@
</style>
<script>
import { mapState } from 'client/libs/store';
import Sidebar from './sidebar';
import ChallengeItem from './challengeItem';
import challengeModal from './challengeModal';
@@ -111,24 +109,18 @@ export default {
},
],
search: '',
filters: {
roles: ['participating'], // This is required for my challenges
},
filters: {},
};
},
mounted () {
this.loadchallanges();
},
computed: {
...mapState({user: 'user.data'}),
filteredChallenges () {
let search = this.search;
let filters = this.filters;
let user = this.$store.state.user.data;
// Always filter by member on this page:
filters.roles = ['participating'];
// @TODO: Move this to the server
return this.challenges.filter((challenge) => {
return this.filterChallenge(challenge, filters, search, user);
@@ -136,9 +128,6 @@ export default {
},
},
methods: {
memberOf (challenge) {
return this.user.challenges.indexOf(challenge._id) !== -1;
},
updateSearch (eventData) {
this.search = eventData.searchTerm;
},