Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

overvall for captcha projects

kruzhambus90e7f1a12ea4
diff --git a/src/api/index.js b/src/api/index.js
index b9db7085d..b50ba4922 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -359,6 +359,17 @@ export const getOverallStats = (pids) =>
: error.response.data.message
})
+export const getOverallStatsCaptcha = (pids) =>
+ api
+ .get(`log/captcha/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(',')}]`)
+ .then((response) => response.data)
+ .catch((error) => {
+ debug('%s', error)
+ throw _isEmpty(error.response.data?.message)
+ ? error.response.data
+ : error.response.data.message
+ })
+
export const getLiveVisitors = (pids) =>
api
.get(`log/hb?pids=[${_map(pids, (pid) => `"${pid}"`).join(',')}]`)
diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsx
index b83d1d07c..15685e9cf 100644
--- a/src/pages/Dashboard/Dashboard.jsx
+++ b/src/pages/Dashboard/Dashboard.jsx
@@ -40,6 +40,7 @@ const ProjectCart = ({
}) => {
const statsDidGrowUp = overall?.percChange >= 0
const [showInviteModal, setShowInviteModal] = useState(false)
+ console.log(overall)
const onAccept = async () => {
const pid = _find(sharedProjects, item => item.project.id === id).id
diff --git a/src/redux/sagas/ui/load_projects.js b/src/redux/sagas/ui/load_projects.js
index 21b6912d8..74bac29a4 100644
--- a/src/redux/sagas/ui/load_projects.js
+++ b/src/redux/sagas/ui/load_projects.js
@@ -7,7 +7,7 @@ import UIActions from 'redux/actions/ui'
import { ENTRIES_PER_PAGE_DASHBOARD } from 'redux/constants'
import {
- getProjects, getOverallStats, getLiveVisitors,
+ getProjects, getOverallStats, getLiveVisitors, getOverallStatsCaptcha,
} from '../../../api'
const debug = Debug('swetrix:rx:s:load-projects')
@@ -29,12 +29,11 @@ export default function* loadProjects({ payload: { take = ENTRIES_PER_PAGE_DASHB
let overall
if (isCaptcha) {
- // try {
- // overall = yield call(getOverallStats, pids, true)
- // } catch (e) {
- // debug('failed to overall stats: %s', e)
- // }
- overall = {}
+ try {
+ overall = yield call(getOverallStatsCaptcha, pids)
+ } catch (e) {
+ debug('failed to overall stats: %s', e)
+ }
} else {
try {
overall = yield call(getOverallStats, pids)