From f3dfc786a9745065ca7baeaf8c5ae3847c2fa328 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Fri, 30 Jun 2023 15:03:43 +0700
Subject: user activity

---
 src/pages/_app.jsx | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'src/pages/_app.jsx')

diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx
index a8d18917..9a8960db 100644
--- a/src/pages/_app.jsx
+++ b/src/pages/_app.jsx
@@ -7,6 +7,7 @@ import { QueryClient, QueryClientProvider } from 'react-query'
 import useDevice from '@/core/hooks/useDevice'
 import { useEffect, useState } from 'react'
 import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
+import axios from 'axios'
 
 const queryClient = new QueryClient()
 
@@ -16,6 +17,14 @@ function MyApp({ Component, pageProps }) {
 
   const [animateLoader, setAnimateLoader] = useState(false)
 
+  useEffect(() => {
+    const data = {
+      page_title: document.title,
+      url: window.location.href
+    }
+    axios.get(`/api/user-activity?page_title=${data.page_title}&url=${data.url}`)
+  }, [])
+
   useEffect(() => {
     const handleRouteChangeStart = () => setAnimateLoader(true)
     const handleRouteChangeComplete = () => setAnimateLoader(false)
-- 
cgit v1.2.3

