diff --git a/pages/api/index.ts b/pages/api/index.ts index 704e0bc..6dbe2d5 100644 --- a/pages/api/index.ts +++ b/pages/api/index.ts @@ -355,7 +355,8 @@ export default async function handler(req, res) { res.status(200).json(data); break; case "getAllPublishersWithStatistics": - res.status(200).json(await dataHelper.getAllPublishersWithStatistics(day)); + let noEndDate = common.parseBool(req.query.noEndDate); + res.status(200).json(await dataHelper.getAllPublishersWithStatistics(day, noEndDate)); default: res.status(200).json({ diff --git a/pages/cart/publishers/stats.tsx b/pages/cart/publishers/stats.tsx index b5fa9a0..38e58d4 100644 --- a/pages/cart/publishers/stats.tsx +++ b/pages/cart/publishers/stats.tsx @@ -67,6 +67,7 @@ function ContactsPage({ allPublishers }) { }); } setFilteredPublishers(filtered); + setPubWithAssignmentsCount(filtered.filter(publisher => publisher.currentMonthAvailabilityHoursCount && publisher.currentMonthAvailabilityHoursCount > 0).length); }, [searchQuery, publisherType, sortField, sortOrder, allPublishers]); useEffect(() => { @@ -75,7 +76,7 @@ function ContactsPage({ allPublishers }) { const month = parseInt(selectedMonth); const filterDate = new Date(new Date().getFullYear(), month - 1, 15); try { - const response = await axiosInstance.get(`/api/?action=getAllPublishersWithStatistics&date=${filterDate.toISOString()}`); + const response = await axiosInstance.get(`/api/?action=getAllPublishersWithStatistics&date=${filterDate.toISOString()}&noEndDate=false`); setPublishers(response.data); setFilteredPublishers(response.data); @@ -101,7 +102,7 @@ function ContactsPage({ allPublishers }) {

Статистика

-
{pubWithAssignmentsCount} участника с предпочитания за месеца (от {allPublishers.length} )
+
{pubWithAssignmentsCount} участника с предпочитания за месеца (от {filteredPublishers.length} )