mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 20:59:16 +00:00
fix: dashboad ticket count conting only logged in user's tickets
This commit is contained in:
12
frontend/src/pages/Dashboard/Chart.js
vendored
12
frontend/src/pages/Dashboard/Chart.js
vendored
@@ -41,17 +41,11 @@ const Chart = () => {
|
||||
setChartData(prevState => {
|
||||
let aux = [...prevState];
|
||||
|
||||
aux.map(a => {
|
||||
aux.forEach(a => {
|
||||
tickets.forEach(ticket => {
|
||||
if (
|
||||
format(startOfHour(parseISO(ticket.createdAt)), "HH:mm") === a.time
|
||||
) {
|
||||
return a.amount++;
|
||||
} else {
|
||||
return a;
|
||||
}
|
||||
format(startOfHour(parseISO(ticket.createdAt)), "HH:mm") === a.time &&
|
||||
a.amount++;
|
||||
});
|
||||
return a;
|
||||
});
|
||||
|
||||
return aux;
|
||||
|
||||
Reference in New Issue
Block a user