Skip to content

Commit 2c8b792

Browse files
committed
onEmpty callback removed from PieChart (current month data)
1 parent e2f30ae commit 2c8b792

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

app/src/components/PieChart/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import { TransactionInterface } from '../../interfaces/transaction';
99
import { ChartInterface, KeyValueNumberInterface } from '../../interfaces/charts';
1010
import { formatToChartNumberObject, capitalize } from '../../utils/format';
1111
import { globalVariables } from '../../styles/variables';
12-
import { ChartDataProps } from '../../pages/Dashboard/Report';
1312

1413
import { Loading } from './styles';
1514

16-
const PieChart: React.FC<ChartDataProps> = ({ onEmpty }) => {
15+
const PieChart: React.FC = () => {
1716
let debitsFormatted: ChartInterface[];
1817
let debits: TransactionInterface[];
1918

@@ -36,12 +35,6 @@ const PieChart: React.FC<ChartDataProps> = ({ onEmpty }) => {
3635
const getAllDataByCurrentMonth = async () => {
3736
const { data: debitData } = await api.get<TransactionInterface[]>('debits/allByCurrentMonth');
3837

39-
if (debitData.length === 0) {
40-
onEmpty();
41-
42-
return;
43-
}
44-
4538
debits = debitData;
4639

4740
formatTransactions();

app/src/pages/Dashboard/Report/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Report = () => {
2626
<LineChart onEmpty={onEmpty} />
2727
<BottomContainer>
2828
<BarChart onEmpty={onEmpty} />
29-
<PieChart onEmpty={onEmpty} />
29+
<PieChart />
3030
</BottomContainer>
3131
</>
3232
) }

0 commit comments

Comments
 (0)