[DEV-216] Fix stat charts in my account (showing only assigned departments) (#1157)

This commit is contained in:
Joel Elias Méndez 2022-02-23 15:08:51 -03:00 committed by GitHub
parent 784d470ba5
commit 2e5bfa611e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -69,14 +69,10 @@ class StaffEditor extends React.Component {
};
componentDidMount() {
const departmentsAssigned = SessionStore.getDepartments().filter((_department, index) => this.state.departments.includes(index));
const departmentsAssignedId = departmentsAssigned.map(department => department.id);
this.retrieveStaffMembers();
this.retrieveTicketsAssigned(INITIAL_API_VALUE);
statsUtils.retrieveStats({
rawForm: this.state.rawForm,
departments: departmentsAssignedId
rawForm: this.state.rawForm
}).then(({data}) => {
this.setState({
ticketData: data,
@ -460,12 +456,8 @@ class StaffEditor extends React.Component {
ticketListLoading: false
});
const departmentsAssigned = SessionStore.getDepartments().filter((_department, index) => this.state.departments.includes(index));
const departmentsAssignedId = departmentsAssigned.map(department => department.id);
statsUtils.retrieveStats({
rawForm: this.state.rawForm,
departments: departmentsAssignedId
rawForm: this.state.rawForm
}).then(({data}) => {
this.setState({ticketData: data, loadingStats: false});
}).catch((error) => {