Open FeXd opened 5 years ago
Great idea! This feels like it should probably be done in the front end when we fetch our in members.
IN the front end, when do they get inactive? by pressing banned or suspended in the edition of the member? so far I tried to suspend them or baned them and nothing in the isActive flag happened.
I was trying to do something like this.
componentDidMount() { fetch('/api/v1/members/', { credentials: 'same-origin' }) .then(checkStatus) .then(parseJSON) .then((data) => { console.log('RESPONSE FRONT END'); console.log(data); let is_active_filter_data = data.filter(function(item){ return item.is_active; }); console.log('FILTERED ARRAY'); console.log(is_active_filter_data); this.setState({ members: is_active_filter_data }); console.log('request succeeded with JSON response', data); }) .catch((error) => { console.log('request failed', error); }); } `
Regarding "when are they inactive: I think the focus is not on banner or suspended members, but rather how often they are coming.
If a member was the shop last week, they should be close to the top of the list. If a member hasn't been to the shop for a few months, they would be lower on the list. If a member hasn't been to the shop in over a year, they should be at the bottom.
Hey @nemesis1346, I would try adding some extra users (inactive, etc) to fixtures.yml
, then with ./manage.py loaddata ...
so you have something to test with.
We could write js tests for this, but It looks like they're jet to be setup?
Should I push the changes so far in a branch of my fork?
Is there some folder or place where you guys have js tests?
Sorry didnt see the feedback before. So then the backend should response back the same list plus some parameter of date of creation? or something like that?
When sorting for members, it would be nice to not have inactive members fill the list first.
Could they be listed last? Or through another search?