Feature/user log entrance
This commit is contained in:
30
src/core/components/ActivityCodeLog.jsx
Normal file
30
src/core/components/ActivityCodeLog.jsx
Normal file
@@ -0,0 +1,30 @@
|
||||
"use client";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { useEffect } from "react";
|
||||
import { ACTIVITY_LOG } from "@/core/utils/routes";
|
||||
|
||||
const ActivityCodeLog = ({ activity_code }) => {
|
||||
const requestServer = useRequest({ notificationShow: false });
|
||||
|
||||
useEffect(() => {
|
||||
if (!activity_code) return;
|
||||
|
||||
const fetchSubItems = async () => {
|
||||
try {
|
||||
await requestServer(ACTIVITY_LOG, "post", {
|
||||
data: {
|
||||
activityCode: activity_code,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error); // Always helpful to log the error for debugging.
|
||||
}
|
||||
};
|
||||
|
||||
fetchSubItems();
|
||||
}, [activity_code, requestServer]);
|
||||
|
||||
return null; // Ensure the component still renders something.
|
||||
};
|
||||
|
||||
export default ActivityCodeLog;
|
||||
Reference in New Issue
Block a user